@@ -213,8 +213,7 @@ pathman_join_pathlist_hook(PlannerInfo *root,
213213 have_dangerous_phv (root , outer -> parent -> relids , required_inner )))
214214 return ;
215215
216- initial_cost_nestloop_compat (root , & workspace , jointype , outer , inner ,
217- extra );
216+ initial_cost_nestloop_compat (root , & workspace , jointype , outer , inner , extra );
218217
219218 pathkeys = build_join_pathkeys (root , joinrel , jointype , outer -> pathkeys );
220219
@@ -771,6 +770,7 @@ pathman_relcache_hook(Datum arg, Oid relid)
771770
772771/*
773772 * Utility function invoker hook.
773+ * NOTE: 'first_arg' is (PlannedStmt *) in PG 10, or (Node *) in PG <= 9.6.
774774 */
775775void
776776#if PG_VERSION_NUM >= 100000
@@ -781,9 +781,9 @@ pathman_process_utility_hook(PlannedStmt *first_arg,
781781 QueryEnvironment * queryEnv ,
782782 DestReceiver * dest , char * completionTag )
783783{
784- Node * parsetree = first_arg -> utilityStmt ;
785- int stmt_location = first_arg -> stmt_location ,
786- stmt_len = first_arg -> stmt_len ;
784+ Node * parsetree = first_arg -> utilityStmt ;
785+ int stmt_location = first_arg -> stmt_location ,
786+ stmt_len = first_arg -> stmt_len ;
787787#else
788788pathman_process_utility_hook (Node * first_arg ,
789789 const char * queryString ,
@@ -792,9 +792,9 @@ pathman_process_utility_hook(Node *first_arg,
792792 DestReceiver * dest ,
793793 char * completionTag )
794794{
795- Node * parsetree = first_arg ;
796- int stmt_location = -1 ,
797- stmt_len = 0 ;
795+ Node * parsetree = first_arg ;
796+ int stmt_location = -1 ,
797+ stmt_len = 0 ;
798798#endif
799799
800800 if (IsPathmanReady ())
@@ -809,8 +809,8 @@ pathman_process_utility_hook(Node *first_arg,
809809 uint64 processed ;
810810
811811 /* Handle our COPY case (and show a special cmd name) */
812- PathmanDoCopy ((CopyStmt * ) parsetree , queryString , stmt_location ,
813- stmt_len , & processed );
812+ PathmanDoCopy ((CopyStmt * ) parsetree , queryString ,
813+ stmt_location , stmt_len , & processed );
814814 if (completionTag )
815815 snprintf (completionTag , COMPLETION_TAG_BUFSIZE ,
816816 "PATHMAN COPY " UINT64_FORMAT , processed );
@@ -845,9 +845,11 @@ pathman_process_utility_hook(Node *first_arg,
845845 }
846846 }
847847
848- /* 'first_arg' is PlannedStmt in pg10 or Node parsetree in pg9.6 and lower */
849- call_process_utility_compat (
850- (process_utility_hook_next ) ? process_utility_hook_next :
851- standard_ProcessUtility ,
852- first_arg , queryString , context , params , queryEnv , dest , completionTag );
848+ /* Finally call process_utility_hook_next or standard_ProcessUtility */
849+ call_process_utility_compat ((process_utility_hook_next ?
850+ process_utility_hook_next :
851+ standard_ProcessUtility ),
852+ first_arg , queryString ,
853+ context , params , queryEnv ,
854+ dest , completionTag );
853855}
0 commit comments