@@ -71,10 +71,10 @@ ProcessUtility_hook_type ProcessUtility_hook = NULL;
71
71
/* local function declarations */
72
72
static void ProcessUtilitySlow (Node * parsetree ,
73
73
const char * queryString ,
74
+ ProcessUtilityContext context ,
74
75
ParamListInfo params ,
75
76
DestReceiver * dest ,
76
- char * completionTag ,
77
- ProcessUtilityContext context );
77
+ char * completionTag );
78
78
static void ExecDropStmt (DropStmt * stmt ,bool isTopLevel );
79
79
80
80
@@ -314,8 +314,9 @@ CheckRestrictedOperation(const char *cmdname)
314
314
*
315
315
*parsetree: the parse tree for the utility statement
316
316
*queryString: original source text of command
317
+ *context: identifies source of statement (toplevel client command,
318
+ *non-toplevel client command, subcommand of a larger utility command)
317
319
*params: parameters to use during execution
318
- *isTopLevel: true if executing a "top level" (interactively issued) command
319
320
*dest: where to send results
320
321
*completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE
321
322
*in which to store a command completion status string.
@@ -331,10 +332,10 @@ CheckRestrictedOperation(const char *cmdname)
331
332
void
332
333
ProcessUtility (Node * parsetree ,
333
334
const char * queryString ,
335
+ ProcessUtilityContext context ,
334
336
ParamListInfo params ,
335
337
DestReceiver * dest ,
336
- char * completionTag ,
337
- ProcessUtilityContext context )
338
+ char * completionTag )
338
339
{
339
340
Assert (queryString != NULL );/* required as of 8.4 */
340
341
@@ -344,11 +345,13 @@ ProcessUtility(Node *parsetree,
344
345
* call standard_ProcessUtility().
345
346
*/
346
347
if (ProcessUtility_hook )
347
- (* ProcessUtility_hook ) (parsetree ,queryString ,params ,
348
- dest ,completionTag ,context );
348
+ (* ProcessUtility_hook ) (parsetree ,queryString ,
349
+ context ,params ,
350
+ dest ,completionTag );
349
351
else
350
- standard_ProcessUtility (parsetree ,queryString ,params ,
351
- dest ,completionTag ,context );
352
+ standard_ProcessUtility (parsetree ,queryString ,
353
+ context ,params ,
354
+ dest ,completionTag );
352
355
}
353
356
354
357
/*
@@ -365,10 +368,10 @@ ProcessUtility(Node *parsetree,
365
368
void
366
369
standard_ProcessUtility (Node * parsetree ,
367
370
const char * queryString ,
371
+ ProcessUtilityContext context ,
368
372
ParamListInfo params ,
369
373
DestReceiver * dest ,
370
- char * completionTag ,
371
- ProcessUtilityContext context )
374
+ char * completionTag )
372
375
{
373
376
bool isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL );
374
377
@@ -817,8 +820,9 @@ standard_ProcessUtility(Node *parsetree,
817
820
DropStmt * stmt = (DropStmt * )parsetree ;
818
821
819
822
if (EventTriggerSupportsObjectType (stmt -> removeType ))
820
- ProcessUtilitySlow (parsetree ,queryString ,params ,
821
- dest ,completionTag ,context );
823
+ ProcessUtilitySlow (parsetree ,queryString ,
824
+ context ,params ,
825
+ dest ,completionTag );
822
826
else
823
827
ExecDropStmt (stmt ,isTopLevel );
824
828
}
@@ -829,8 +833,9 @@ standard_ProcessUtility(Node *parsetree,
829
833
RenameStmt * stmt = (RenameStmt * )parsetree ;
830
834
831
835
if (EventTriggerSupportsObjectType (stmt -> renameType ))
832
- ProcessUtilitySlow (parsetree ,queryString ,params ,
833
- dest ,completionTag ,context );
836
+ ProcessUtilitySlow (parsetree ,queryString ,
837
+ context ,params ,
838
+ dest ,completionTag );
834
839
else
835
840
ExecRenameStmt (stmt );
836
841
}
@@ -841,8 +846,9 @@ standard_ProcessUtility(Node *parsetree,
841
846
AlterObjectSchemaStmt * stmt = (AlterObjectSchemaStmt * )parsetree ;
842
847
843
848
if (EventTriggerSupportsObjectType (stmt -> objectType ))
844
- ProcessUtilitySlow (parsetree ,queryString ,params ,
845
- dest ,completionTag ,context );
849
+ ProcessUtilitySlow (parsetree ,queryString ,
850
+ context ,params ,
851
+ dest ,completionTag );
846
852
else
847
853
ExecAlterObjectSchemaStmt (stmt );
848
854
}
@@ -853,17 +859,19 @@ standard_ProcessUtility(Node *parsetree,
853
859
AlterOwnerStmt * stmt = (AlterOwnerStmt * )parsetree ;
854
860
855
861
if (EventTriggerSupportsObjectType (stmt -> objectType ))
856
- ProcessUtilitySlow (parsetree ,queryString ,params ,
857
- dest ,completionTag ,context );
862
+ ProcessUtilitySlow (parsetree ,queryString ,
863
+ context ,params ,
864
+ dest ,completionTag );
858
865
else
859
866
ExecAlterOwnerStmt (stmt );
860
867
}
861
868
break ;
862
869
863
870
default :
864
871
/* All other statement types have event trigger support */
865
- ProcessUtilitySlow (parsetree ,queryString ,params ,
866
- dest ,completionTag ,context );
872
+ ProcessUtilitySlow (parsetree ,queryString ,
873
+ context ,params ,
874
+ dest ,completionTag );
867
875
break ;
868
876
}
869
877
}
@@ -876,10 +884,10 @@ standard_ProcessUtility(Node *parsetree,
876
884
static void
877
885
ProcessUtilitySlow (Node * parsetree ,
878
886
const char * queryString ,
887
+ ProcessUtilityContext context ,
879
888
ParamListInfo params ,
880
889
DestReceiver * dest ,
881
- char * completionTag ,
882
- ProcessUtilityContext context )
890
+ char * completionTag )
883
891
{
884
892
bool isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL );
885
893
bool isCompleteQuery = (context <=PROCESS_UTILITY_QUERY );
@@ -966,10 +974,10 @@ ProcessUtilitySlow(Node *parsetree,
966
974
/* Recurse for anything else */
967
975
ProcessUtility (stmt ,
968
976
queryString ,
977
+ PROCESS_UTILITY_SUBCOMMAND ,
969
978
params ,
970
979
None_Receiver ,
971
- NULL ,
972
- PROCESS_UTILITY_GENERATED );
980
+ NULL );
973
981
}
974
982
975
983
/* Need CCI between commands */
@@ -1017,10 +1025,10 @@ ProcessUtilitySlow(Node *parsetree,
1017
1025
/* Recurse for anything else */
1018
1026
ProcessUtility (stmt ,
1019
1027
queryString ,
1028
+ PROCESS_UTILITY_SUBCOMMAND ,
1020
1029
params ,
1021
1030
None_Receiver ,
1022
- NULL ,
1023
- PROCESS_UTILITY_GENERATED );
1031
+ NULL );
1024
1032
}
1025
1033
1026
1034
/* Need CCI between commands */