@@ -865,13 +865,9 @@ pgws_planner_hook(Query *parse,
865
865
int cursorOptions ,
866
866
ParamListInfo boundParams )
867
867
{
868
- if (MyProc )
869
- {
870
- int i = MyProc - ProcGlobal -> allProcs ;
871
- if (!pgws_proc_queryids [i ])
872
- pgws_proc_queryids [i ] = parse -> queryId ;
873
-
874
- }
868
+ int i = MyProc - ProcGlobal -> allProcs ;
869
+ if (!pgws_proc_queryids [i ])
870
+ pgws_proc_queryids [i ] = parse -> queryId ;
875
871
876
872
/* Invoke original hook if needed */
877
873
if (planner_hook_next )
@@ -894,14 +890,9 @@ pgws_planner_hook(Query *parse,
894
890
static void
895
891
pgws_ExecutorStart (QueryDesc * queryDesc , int eflags )
896
892
{
897
- int i ;
898
-
899
- if (MyProc )
900
- {
901
- i = MyProc - ProcGlobal -> allProcs ;
902
- if (!pgws_proc_queryids [i ])
903
- pgws_proc_queryids [i ] = queryDesc -> plannedstmt -> queryId ;
904
- }
893
+ int i = MyProc - ProcGlobal -> allProcs ;
894
+ if (!pgws_proc_queryids [i ])
895
+ pgws_proc_queryids [i ] = queryDesc -> plannedstmt -> queryId ;
905
896
906
897
if (prev_ExecutorStart )
907
898
prev_ExecutorStart (queryDesc , eflags );
@@ -915,8 +906,7 @@ pgws_ExecutorStart(QueryDesc *queryDesc, int eflags)
915
906
static void
916
907
pgws_ExecutorEnd (QueryDesc * queryDesc )
917
908
{
918
- if (MyProc )
919
- pgws_proc_queryids [MyProc - ProcGlobal -> allProcs ] = UINT64CONST (0 );
909
+ pgws_proc_queryids [MyProc - ProcGlobal -> allProcs ] = UINT64CONST (0 );
920
910
921
911
if (prev_ExecutorEnd )
922
912
prev_ExecutorEnd (queryDesc );
0 commit comments