mirror of https://github.com/citusdata/citus.git
Rename CitusProcessUtility -> ProcessUtilityForNode
parent
082899ffa4
commit
8df58926c5
|
@ -629,7 +629,7 @@ ConvertTable(TableConversionState *con)
|
|||
Node *parseTree = ParseTreeNode(tableCreationSql);
|
||||
|
||||
RelayEventExtendNames(parseTree, con->schemaName, con->hashOfName);
|
||||
CitusProcessUtility(parseTree, tableCreationSql, PROCESS_UTILITY_TOPLEVEL,
|
||||
ProcessUtilityParseTree(parseTree, tableCreationSql, PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL, None_Receiver, NULL);
|
||||
}
|
||||
|
||||
|
@ -682,7 +682,8 @@ ConvertTable(TableConversionState *con)
|
|||
{
|
||||
Node *parseTree = ParseTreeNode(attachPartitionCommand);
|
||||
|
||||
CitusProcessUtility(parseTree, attachPartitionCommand, PROCESS_UTILITY_TOPLEVEL,
|
||||
ProcessUtilityParseTree(parseTree, attachPartitionCommand,
|
||||
PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL, None_Receiver, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -426,7 +426,7 @@ ExecuteAndLogDDLCommand(const char *commandString)
|
|||
ereport(DEBUG4, (errmsg("executing \"%s\"", commandString)));
|
||||
|
||||
Node *parseTree = ParseTreeNode(commandString);
|
||||
CitusProcessUtility(parseTree, commandString, PROCESS_UTILITY_TOPLEVEL,
|
||||
ProcessUtilityParseTree(parseTree, commandString, PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL, None_Receiver, NULL);
|
||||
}
|
||||
|
||||
|
@ -478,6 +478,6 @@ ExecuteForeignKeyCreateCommand(const char *commandString, bool skip_validation)
|
|||
"command \"%s\"", commandString)));
|
||||
}
|
||||
|
||||
CitusProcessUtility(parseTree, commandString, PROCESS_UTILITY_TOPLEVEL,
|
||||
ProcessUtilityParseTree(parseTree, commandString, PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL, None_Receiver, NULL);
|
||||
}
|
||||
|
|
|
@ -84,11 +84,12 @@ static bool IsDropSchemaOrDB(Node *parsetree);
|
|||
|
||||
|
||||
/*
|
||||
* CitusProcessUtility is a convenience method to create a PlannedStmt out of pieces of a
|
||||
* utility statement before invoking ProcessUtility.
|
||||
* ProcessUtilityForParseTree is a convenience method to create a PlannedStmt out of
|
||||
* pieces of a utility statement before invoking ProcessUtility.
|
||||
*/
|
||||
void
|
||||
CitusProcessUtility(Node *node, const char *queryString, ProcessUtilityContext context,
|
||||
ProcessUtilityParseTree(Node *node, const char *queryString, ProcessUtilityContext
|
||||
context,
|
||||
ParamListInfo params, DestReceiver *dest,
|
||||
QueryCompletionCompat *completionTag)
|
||||
{
|
||||
|
|
|
@ -409,8 +409,9 @@ LocallyExecuteUtilityTask(const char *localTaskQueryCommand)
|
|||
* It is a regular utility command we should execute it locally via
|
||||
* process utility.
|
||||
*/
|
||||
CitusProcessUtility(localTaskRawParseTree, localTaskQueryCommand,
|
||||
PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver, NULL);
|
||||
ProcessUtilityParseTree(localTaskRawParseTree, localTaskQueryCommand,
|
||||
PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ alter_role_if_exists(PG_FUNCTION_ARGS)
|
|||
|
||||
Node *parseTree = ParseTreeNode(utilityQuery);
|
||||
|
||||
CitusProcessUtility(parseTree, utilityQuery, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
ProcessUtilityParseTree(parseTree, utilityQuery, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
None_Receiver, NULL);
|
||||
|
||||
PG_RETURN_BOOL(true);
|
||||
|
@ -96,7 +96,7 @@ worker_create_or_alter_role(PG_FUNCTION_ARGS)
|
|||
quote_literal_cstr(createRoleUtilityQuery))));
|
||||
}
|
||||
|
||||
CitusProcessUtility(parseTree,
|
||||
ProcessUtilityParseTree(parseTree,
|
||||
createRoleUtilityQuery,
|
||||
PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL,
|
||||
|
@ -124,7 +124,7 @@ worker_create_or_alter_role(PG_FUNCTION_ARGS)
|
|||
quote_literal_cstr(alterRoleUtilityQuery))));
|
||||
}
|
||||
|
||||
CitusProcessUtility(parseTree,
|
||||
ProcessUtilityParseTree(parseTree,
|
||||
alterRoleUtilityQuery,
|
||||
PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL,
|
||||
|
|
|
@ -110,13 +110,13 @@ worker_create_or_replace_object(PG_FUNCTION_ARGS)
|
|||
|
||||
RenameStmt *renameStmt = CreateRenameStatement(&address, newName);
|
||||
const char *sqlRenameStmt = DeparseTreeNode((Node *) renameStmt);
|
||||
CitusProcessUtility((Node *) renameStmt, sqlRenameStmt,
|
||||
ProcessUtilityParseTree((Node *) renameStmt, sqlRenameStmt,
|
||||
PROCESS_UTILITY_TOPLEVEL,
|
||||
NULL, None_Receiver, NULL);
|
||||
}
|
||||
|
||||
/* apply create statement locally */
|
||||
CitusProcessUtility(parseTree, sqlStatement, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
ProcessUtilityParseTree(parseTree, sqlStatement, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
None_Receiver, NULL);
|
||||
|
||||
/* type has been created */
|
||||
|
|
|
@ -396,7 +396,7 @@ worker_apply_shard_ddl_command(PG_FUNCTION_ARGS)
|
|||
|
||||
/* extend names in ddl command and apply extended command */
|
||||
RelayEventExtendNames(ddlCommandNode, schemaName, shardId);
|
||||
CitusProcessUtility(ddlCommandNode, ddlCommand, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
ProcessUtilityParseTree(ddlCommandNode, ddlCommand, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
None_Receiver, NULL);
|
||||
|
||||
PG_RETURN_VOID();
|
||||
|
@ -428,7 +428,7 @@ worker_apply_inter_shard_ddl_command(PG_FUNCTION_ARGS)
|
|||
RelayEventExtendNamesForInterShardCommands(ddlCommandNode, leftShardId,
|
||||
leftShardSchemaName, rightShardId,
|
||||
rightShardSchemaName);
|
||||
CitusProcessUtility(ddlCommandNode, ddlCommand, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
ProcessUtilityParseTree(ddlCommandNode, ddlCommand, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
None_Receiver, NULL);
|
||||
|
||||
PG_RETURN_VOID();
|
||||
|
@ -461,7 +461,7 @@ worker_apply_sequence_command(PG_FUNCTION_ARGS)
|
|||
}
|
||||
|
||||
/* run the CREATE SEQUENCE command */
|
||||
CitusProcessUtility(commandNode, commandString, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
ProcessUtilityParseTree(commandNode, commandString, PROCESS_UTILITY_TOPLEVEL, NULL,
|
||||
None_Receiver, NULL);
|
||||
CommandCounterIncrement();
|
||||
|
||||
|
@ -668,7 +668,7 @@ worker_append_table_to_shard(PG_FUNCTION_ARGS)
|
|||
GetUserIdAndSecContext(&savedUserId, &savedSecurityContext);
|
||||
SetUserIdAndSecContext(CitusExtensionOwner(), SECURITY_LOCAL_USERID_CHANGE);
|
||||
|
||||
CitusProcessUtility((Node *) localCopyCommand, queryString->data,
|
||||
ProcessUtilityParseTree((Node *) localCopyCommand, queryString->data,
|
||||
PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver, NULL);
|
||||
|
||||
SetUserIdAndSecContext(savedUserId, savedSecurityContext);
|
||||
|
@ -781,7 +781,7 @@ AlterSequenceMinMax(Oid sequenceId, char *schemaName, char *sequenceName,
|
|||
SetDefElemArg(alterSequenceStatement, "restart", startFloatArg);
|
||||
|
||||
/* since the command is an AlterSeqStmt, a dummy command string works fine */
|
||||
CitusProcessUtility((Node *) alterSequenceStatement, dummyString,
|
||||
ProcessUtilityParseTree((Node *) alterSequenceStatement, dummyString,
|
||||
PROCESS_UTILITY_TOPLEVEL, NULL, None_Receiver, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,8 +65,9 @@ extern void multi_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
|||
struct QueryEnvironment *queryEnv, DestReceiver *dest,
|
||||
QueryCompletionCompat *completionTag
|
||||
);
|
||||
extern void CitusProcessUtility(Node *node, const char *queryString,
|
||||
ProcessUtilityContext context, ParamListInfo params,
|
||||
extern void ProcessUtilityParseTree(Node *node, const char *queryString,
|
||||
ProcessUtilityContext context, ParamListInfo
|
||||
params,
|
||||
DestReceiver *dest,
|
||||
QueryCompletionCompat *completionTag
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue