mirror of https://github.com/citusdata/citus.git
Rename some more foreach_ptr to foreach_declared_ptr
parent
c02d899b6c
commit
17b4122e84
|
@ -230,7 +230,7 @@ FilterDistributedDatabases(List *databases)
|
||||||
{
|
{
|
||||||
List *distributedDatabases = NIL;
|
List *distributedDatabases = NIL;
|
||||||
String *databaseName = NULL;
|
String *databaseName = NULL;
|
||||||
foreach_ptr(databaseName, databases)
|
foreach_declared_ptr(databaseName, databases)
|
||||||
{
|
{
|
||||||
bool missingOk = true;
|
bool missingOk = true;
|
||||||
ObjectAddress *dbAddress =
|
ObjectAddress *dbAddress =
|
||||||
|
@ -253,7 +253,7 @@ static bool
|
||||||
IsSetTablespaceStatement(AlterDatabaseStmt *stmt)
|
IsSetTablespaceStatement(AlterDatabaseStmt *stmt)
|
||||||
{
|
{
|
||||||
DefElem *def = NULL;
|
DefElem *def = NULL;
|
||||||
foreach_ptr(def, stmt->options)
|
foreach_declared_ptr(def, stmt->options)
|
||||||
{
|
{
|
||||||
if (strcmp(def->defname, "tablespace") == 0)
|
if (strcmp(def->defname, "tablespace") == 0)
|
||||||
{
|
{
|
||||||
|
@ -500,7 +500,7 @@ PreprocessCreateDatabaseStmt(Node *node, const char *queryString,
|
||||||
|
|
||||||
List *remoteNodes = TargetWorkerSetNodeList(ALL_SHARD_NODES, RowShareLock);
|
List *remoteNodes = TargetWorkerSetNodeList(ALL_SHARD_NODES, RowShareLock);
|
||||||
WorkerNode *remoteNode = NULL;
|
WorkerNode *remoteNode = NULL;
|
||||||
foreach_ptr(remoteNode, remoteNodes)
|
foreach_declared_ptr(remoteNode, remoteNodes)
|
||||||
{
|
{
|
||||||
InsertCleanupRecordOutsideTransaction(
|
InsertCleanupRecordOutsideTransaction(
|
||||||
CLEANUP_OBJECT_DATABASE,
|
CLEANUP_OBJECT_DATABASE,
|
||||||
|
@ -723,7 +723,7 @@ void
|
||||||
EnsureSupportedCreateDatabaseCommand(CreatedbStmt *stmt)
|
EnsureSupportedCreateDatabaseCommand(CreatedbStmt *stmt)
|
||||||
{
|
{
|
||||||
DefElem *option = NULL;
|
DefElem *option = NULL;
|
||||||
foreach_ptr(option, stmt->options)
|
foreach_declared_ptr(option, stmt->options)
|
||||||
{
|
{
|
||||||
if (strcmp(option->defname, "oid") == 0)
|
if (strcmp(option->defname, "oid") == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -162,7 +162,7 @@ EnsureRequiredObjectSetExistOnAllNodes(const ObjectAddress *target,
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectAddress *object = NULL;
|
ObjectAddress *object = NULL;
|
||||||
foreach_ptr(object, objectsToBeCreated)
|
foreach_declared_ptr(object, objectsToBeCreated)
|
||||||
{
|
{
|
||||||
List *dependencyCommands = GetDependencyCreateDDLCommands(object);
|
List *dependencyCommands = GetDependencyCreateDDLCommands(object);
|
||||||
ddlCommands = list_concat(ddlCommands, dependencyCommands);
|
ddlCommands = list_concat(ddlCommands, dependencyCommands);
|
||||||
|
|
|
@ -255,7 +255,7 @@ static void
|
||||||
DropRoleStmtUnmarkDistOnLocalMainDb(DropRoleStmt *dropRoleStmt)
|
DropRoleStmtUnmarkDistOnLocalMainDb(DropRoleStmt *dropRoleStmt)
|
||||||
{
|
{
|
||||||
RoleSpec *roleSpec = NULL;
|
RoleSpec *roleSpec = NULL;
|
||||||
foreach_ptr(roleSpec, dropRoleStmt->roles)
|
foreach_declared_ptr(roleSpec, dropRoleStmt->roles)
|
||||||
{
|
{
|
||||||
Oid roleOid = get_role_oid(roleSpec->rolename,
|
Oid roleOid = get_role_oid(roleSpec->rolename,
|
||||||
dropRoleStmt->missing_ok);
|
dropRoleStmt->missing_ok);
|
||||||
|
|
|
@ -580,7 +580,7 @@ GenerateCreateOrAlterRoleCommand(Oid roleOid)
|
||||||
*/
|
*/
|
||||||
List *secLabelOnRoleStmts = GenerateSecLabelOnRoleStmts(roleOid, rolename);
|
List *secLabelOnRoleStmts = GenerateSecLabelOnRoleStmts(roleOid, rolename);
|
||||||
stmt = NULL;
|
stmt = NULL;
|
||||||
foreach_ptr(stmt, secLabelOnRoleStmts)
|
foreach_declared_ptr(stmt, secLabelOnRoleStmts)
|
||||||
{
|
{
|
||||||
completeRoleList = lappend(completeRoleList, DeparseTreeNode(stmt));
|
completeRoleList = lappend(completeRoleList, DeparseTreeNode(stmt));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1525,10 +1525,10 @@ NontransactionalNodeDDLTaskList(TargetWorkerSet targets, List *commands,
|
||||||
{
|
{
|
||||||
List *ddlJobs = NodeDDLTaskList(targets, commands);
|
List *ddlJobs = NodeDDLTaskList(targets, commands);
|
||||||
DDLJob *ddlJob = NULL;
|
DDLJob *ddlJob = NULL;
|
||||||
foreach_ptr(ddlJob, ddlJobs)
|
foreach_declared_ptr(ddlJob, ddlJobs)
|
||||||
{
|
{
|
||||||
Task *task = NULL;
|
Task *task = NULL;
|
||||||
foreach_ptr(task, ddlJob->taskList)
|
foreach_declared_ptr(task, ddlJob->taskList)
|
||||||
{
|
{
|
||||||
task->cannotBeExecutedInTransaction = true;
|
task->cannotBeExecutedInTransaction = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ static void
|
||||||
AppendBasicAlterDatabaseOptions(StringInfo buf, AlterDatabaseStmt *stmt)
|
AppendBasicAlterDatabaseOptions(StringInfo buf, AlterDatabaseStmt *stmt)
|
||||||
{
|
{
|
||||||
DefElem *def = NULL;
|
DefElem *def = NULL;
|
||||||
foreach_ptr(def, stmt->options)
|
foreach_declared_ptr(def, stmt->options)
|
||||||
{
|
{
|
||||||
DefElemOptionToStatement(buf, def, alterDatabaseOptionFormats, lengthof(
|
DefElemOptionToStatement(buf, def, alterDatabaseOptionFormats, lengthof(
|
||||||
alterDatabaseOptionFormats));
|
alterDatabaseOptionFormats));
|
||||||
|
@ -289,7 +289,7 @@ AppendCreateDatabaseStmt(StringInfo buf, CreatedbStmt *stmt)
|
||||||
quote_identifier(stmt->dbname));
|
quote_identifier(stmt->dbname));
|
||||||
|
|
||||||
DefElem *option = NULL;
|
DefElem *option = NULL;
|
||||||
foreach_ptr(option, stmt->options)
|
foreach_declared_ptr(option, stmt->options)
|
||||||
{
|
{
|
||||||
DefElemOptionToStatement(buf, option, createDatabaseOptionFormats,
|
DefElemOptionToStatement(buf, option, createDatabaseOptionFormats,
|
||||||
lengthof(createDatabaseOptionFormats));
|
lengthof(createDatabaseOptionFormats));
|
||||||
|
|
|
@ -932,7 +932,7 @@ TryDropDatabaseOutsideTransaction(char *databaseName, char *nodeName, int nodePo
|
||||||
bool executeCommand = true;
|
bool executeCommand = true;
|
||||||
|
|
||||||
const char *commandString = NULL;
|
const char *commandString = NULL;
|
||||||
foreach_ptr(commandString, commandList)
|
foreach_declared_ptr(commandString, commandList)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Cannot use SendOptionalCommandListToWorkerOutsideTransactionWithConnection()
|
* Cannot use SendOptionalCommandListToWorkerOutsideTransactionWithConnection()
|
||||||
|
|
|
@ -109,7 +109,7 @@ IsMetadataSynced(void)
|
||||||
List *workerList = ActivePrimaryNonCoordinatorNodeList(NoLock);
|
List *workerList = ActivePrimaryNonCoordinatorNodeList(NoLock);
|
||||||
|
|
||||||
WorkerNode *workerNode = NULL;
|
WorkerNode *workerNode = NULL;
|
||||||
foreach_ptr(workerNode, workerList)
|
foreach_declared_ptr(workerNode, workerList)
|
||||||
{
|
{
|
||||||
if (workerNode->hasMetadata && !workerNode->metadataSynced)
|
if (workerNode->hasMetadata && !workerNode->metadataSynced)
|
||||||
{
|
{
|
||||||
|
|
|
@ -193,7 +193,7 @@ void
|
||||||
SendCommandListToRemoteNodesWithMetadata(List *commands)
|
SendCommandListToRemoteNodesWithMetadata(List *commands)
|
||||||
{
|
{
|
||||||
char *command = NULL;
|
char *command = NULL;
|
||||||
foreach_ptr(command, commands)
|
foreach_declared_ptr(command, commands)
|
||||||
{
|
{
|
||||||
SendCommandToRemoteNodesWithMetadata(command);
|
SendCommandToRemoteNodesWithMetadata(command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue