@ -71,10 +71,10 @@ ProcessUtility_hook_type ProcessUtility_hook = NULL;
/* local function declarations */
/* local function declarations */
static void ProcessUtilitySlow ( Node * parsetree ,
static void ProcessUtilitySlow ( Node * parsetree ,
const char * queryString ,
const char * queryString ,
ProcessUtilityContext context ,
ParamListInfo params ,
ParamListInfo params ,
DestReceiver * dest ,
DestReceiver * dest ,
char * completionTag ,
char * completionTag ) ;
ProcessUtilityContext context ) ;
static void ExecDropStmt ( DropStmt * stmt , bool isTopLevel ) ;
static void ExecDropStmt ( DropStmt * stmt , bool isTopLevel ) ;
@ -314,8 +314,9 @@ CheckRestrictedOperation(const char *cmdname)
*
*
* parsetree : the parse tree for the utility statement
* parsetree : the parse tree for the utility statement
* queryString : original source text of command
* queryString : original source text of command
* context : identifies source of statement ( toplevel client command ,
* non - toplevel client command , subcommand of a larger utility command )
* params : parameters to use during execution
* params : parameters to use during execution
* isTopLevel : true if executing a " top level " ( interactively issued ) command
* dest : where to send results
* dest : where to send results
* completionTag : points to a buffer of size COMPLETION_TAG_BUFSIZE
* completionTag : points to a buffer of size COMPLETION_TAG_BUFSIZE
* in which to store a command completion status string .
* in which to store a command completion status string .
@ -331,10 +332,10 @@ CheckRestrictedOperation(const char *cmdname)
void
void
ProcessUtility ( Node * parsetree ,
ProcessUtility ( Node * parsetree ,
const char * queryString ,
const char * queryString ,
ProcessUtilityContext context ,
ParamListInfo params ,
ParamListInfo params ,
DestReceiver * dest ,
DestReceiver * dest ,
char * completionTag ,
char * completionTag )
ProcessUtilityContext context )
{
{
Assert ( queryString ! = NULL ) ; /* required as of 8.4 */
Assert ( queryString ! = NULL ) ; /* required as of 8.4 */
@ -344,11 +345,13 @@ ProcessUtility(Node *parsetree,
* call standard_ProcessUtility ( ) .
* call standard_ProcessUtility ( ) .
*/
*/
if ( ProcessUtility_hook )
if ( ProcessUtility_hook )
( * ProcessUtility_hook ) ( parsetree , queryString , params ,
( * ProcessUtility_hook ) ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
else
else
standard_ProcessUtility ( parsetree , queryString , params ,
standard_ProcessUtility ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
}
}
/*
/*
@ -365,10 +368,10 @@ ProcessUtility(Node *parsetree,
void
void
standard_ProcessUtility ( Node * parsetree ,
standard_ProcessUtility ( Node * parsetree ,
const char * queryString ,
const char * queryString ,
ProcessUtilityContext context ,
ParamListInfo params ,
ParamListInfo params ,
DestReceiver * dest ,
DestReceiver * dest ,
char * completionTag ,
char * completionTag )
ProcessUtilityContext context )
{
{
bool isTopLevel = ( context = = PROCESS_UTILITY_TOPLEVEL ) ;
bool isTopLevel = ( context = = PROCESS_UTILITY_TOPLEVEL ) ;
@ -817,8 +820,9 @@ standard_ProcessUtility(Node *parsetree,
DropStmt * stmt = ( DropStmt * ) parsetree ;
DropStmt * stmt = ( DropStmt * ) parsetree ;
if ( EventTriggerSupportsObjectType ( stmt - > removeType ) )
if ( EventTriggerSupportsObjectType ( stmt - > removeType ) )
ProcessUtilitySlow ( parsetree , queryString , params ,
ProcessUtilitySlow ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
else
else
ExecDropStmt ( stmt , isTopLevel ) ;
ExecDropStmt ( stmt , isTopLevel ) ;
}
}
@ -829,8 +833,9 @@ standard_ProcessUtility(Node *parsetree,
RenameStmt * stmt = ( RenameStmt * ) parsetree ;
RenameStmt * stmt = ( RenameStmt * ) parsetree ;
if ( EventTriggerSupportsObjectType ( stmt - > renameType ) )
if ( EventTriggerSupportsObjectType ( stmt - > renameType ) )
ProcessUtilitySlow ( parsetree , queryString , params ,
ProcessUtilitySlow ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
else
else
ExecRenameStmt ( stmt ) ;
ExecRenameStmt ( stmt ) ;
}
}
@ -841,8 +846,9 @@ standard_ProcessUtility(Node *parsetree,
AlterObjectSchemaStmt * stmt = ( AlterObjectSchemaStmt * ) parsetree ;
AlterObjectSchemaStmt * stmt = ( AlterObjectSchemaStmt * ) parsetree ;
if ( EventTriggerSupportsObjectType ( stmt - > objectType ) )
if ( EventTriggerSupportsObjectType ( stmt - > objectType ) )
ProcessUtilitySlow ( parsetree , queryString , params ,
ProcessUtilitySlow ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
else
else
ExecAlterObjectSchemaStmt ( stmt ) ;
ExecAlterObjectSchemaStmt ( stmt ) ;
}
}
@ -853,8 +859,9 @@ standard_ProcessUtility(Node *parsetree,
AlterOwnerStmt * stmt = ( AlterOwnerStmt * ) parsetree ;
AlterOwnerStmt * stmt = ( AlterOwnerStmt * ) parsetree ;
if ( EventTriggerSupportsObjectType ( stmt - > objectType ) )
if ( EventTriggerSupportsObjectType ( stmt - > objectType ) )
ProcessUtilitySlow ( parsetree , queryString , params ,
ProcessUtilitySlow ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
else
else
ExecAlterOwnerStmt ( stmt ) ;
ExecAlterOwnerStmt ( stmt ) ;
}
}
@ -862,8 +869,9 @@ standard_ProcessUtility(Node *parsetree,
default :
default :
/* All other statement types have event trigger support */
/* All other statement types have event trigger support */
ProcessUtilitySlow ( parsetree , queryString , params ,
ProcessUtilitySlow ( parsetree , queryString ,
dest , completionTag , context ) ;
context , params ,
dest , completionTag ) ;
break ;
break ;
}
}
}
}
@ -876,10 +884,10 @@ standard_ProcessUtility(Node *parsetree,
static void
static void
ProcessUtilitySlow ( Node * parsetree ,
ProcessUtilitySlow ( Node * parsetree ,
const char * queryString ,
const char * queryString ,
ProcessUtilityContext context ,
ParamListInfo params ,
ParamListInfo params ,
DestReceiver * dest ,
DestReceiver * dest ,
char * completionTag ,
char * completionTag )
ProcessUtilityContext context )
{
{
bool isTopLevel = ( context = = PROCESS_UTILITY_TOPLEVEL ) ;
bool isTopLevel = ( context = = PROCESS_UTILITY_TOPLEVEL ) ;
bool isCompleteQuery = ( context < = PROCESS_UTILITY_QUERY ) ;
bool isCompleteQuery = ( context < = PROCESS_UTILITY_QUERY ) ;
@ -966,10 +974,10 @@ ProcessUtilitySlow(Node *parsetree,
/* Recurse for anything else */
/* Recurse for anything else */
ProcessUtility ( stmt ,
ProcessUtility ( stmt ,
queryString ,
queryString ,
PROCESS_UTILITY_SUBCOMMAND ,
params ,
params ,
None_Receiver ,
None_Receiver ,
NULL ,
NULL ) ;
PROCESS_UTILITY_GENERATED ) ;
}
}
/* Need CCI between commands */
/* Need CCI between commands */
@ -1017,10 +1025,10 @@ ProcessUtilitySlow(Node *parsetree,
/* Recurse for anything else */
/* Recurse for anything else */
ProcessUtility ( stmt ,
ProcessUtility ( stmt ,
queryString ,
queryString ,
PROCESS_UTILITY_SUBCOMMAND ,
params ,
params ,
None_Receiver ,
None_Receiver ,
NULL ,
NULL ) ;
PROCESS_UTILITY_GENERATED ) ;
}
}
/* Need CCI between commands */
/* Need CCI between commands */