@@ -755,24 +755,25 @@ pathman_relcache_hook(Datum arg, Oid relid)
755
755
*/
756
756
void
757
757
#if PG_VERSION_NUM >= 100000
758
- pathman_process_utility_hook (PlannedStmt * pstmt ,
758
+ pathman_process_utility_hook (PlannedStmt * first_arg ,
759
759
const char * queryString ,
760
760
ProcessUtilityContext context ,
761
761
ParamListInfo params ,
762
762
QueryEnvironment * queryEnv ,
763
763
DestReceiver * dest , char * completionTag )
764
764
{
765
- Node * parsetree = pstmt -> utilityStmt ;
766
- int stmt_location = pstmt -> stmt_location ,
767
- stmt_len = pstmt -> stmt_len ;
765
+ Node * parsetree = first_arg -> utilityStmt ;
766
+ int stmt_location = first_arg -> stmt_location ,
767
+ stmt_len = first_arg -> stmt_len ;
768
768
#else
769
- pathman_process_utility_hook (Node * parsetree ,
769
+ pathman_process_utility_hook (Node * first_arg ,
770
770
const char * queryString ,
771
771
ProcessUtilityContext context ,
772
772
ParamListInfo params ,
773
773
DestReceiver * dest ,
774
774
char * completionTag )
775
775
{
776
+ Node * parsetree = first_arg ;
776
777
int stmt_location = -1 ,
777
778
stmt_len = 0 ;
778
779
#endif
@@ -825,27 +826,9 @@ pathman_process_utility_hook(Node *parsetree,
825
826
}
826
827
}
827
828
828
- #if PG_VERSION_NUM >= 100000
829
- /* Call hooks set by other extensions if needed */
830
- if (process_utility_hook_next )
831
- process_utility_hook_next (pstmt , queryString ,
832
- context , params , queryEnv ,
833
- dest , completionTag );
834
- /* Else call internal implementation */
835
- else
836
- standard_ProcessUtility (pstmt , queryString ,
837
- context , params , queryEnv ,
838
- dest , completionTag );
839
- #else
840
- /* Call hooks set by other extensions if needed */
841
- if (process_utility_hook_next )
842
- process_utility_hook_next (parsetree , queryString ,
843
- context , params ,
844
- dest , completionTag );
845
- /* Else call internal implementation */
846
- else
847
- standard_ProcessUtility (parsetree , queryString ,
848
- context , params ,
849
- dest , completionTag );
850
- #endif
829
+ /* 'first_arg' is PlannedStmt in pg10 or Node parsetree in pg9.6 and lower */
830
+ call_process_utility_compat (
831
+ (process_utility_hook_next ) ? process_utility_hook_next :
832
+ standard_ProcessUtility ,
833
+ first_arg , queryString , context , params , queryEnv , dest , completionTag );
851
834
}
0 commit comments