Fix indentation for shell table func

velioglu/wo_seq_test_1
Burak Velioglu 2022-01-16 16:24:59 +03:00
parent 427bdf08a0
commit 5e2e5c3470
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
1 changed files with 23 additions and 24 deletions

View File

@ -1775,35 +1775,34 @@ CreateShellTableOnWorkers(Oid relationId)
{ {
/* if the table is owned by an extension we don't create */ /* if the table is owned by an extension we don't create */
bool tableOwnedByExtension = IsTableOwnedByExtension(relationId); bool tableOwnedByExtension = IsTableOwnedByExtension(relationId);
if (tableOwnedByExtension)
if (!tableOwnedByExtension)
{ {
List *commandList = NIL; return;
IncludeSequenceDefaults includeSequenceDefaults = }
WORKER_NEXTVAL_SEQUENCE_DEFAULTS;
List *tableDDLCommands = GetFullTableCreationCommands(relationId, List *commandList = NIL;
includeSequenceDefaults); IncludeSequenceDefaults includeSequenceDefaults = WORKER_NEXTVAL_SEQUENCE_DEFAULTS;
TableDDLCommand *tableDDLCommand = NULL;
foreach_ptr(tableDDLCommand, tableDDLCommands)
{
Assert(CitusIsA(tableDDLCommand, TableDDLCommand));
commandList = lappend(commandList, GetTableDDLCommand(tableDDLCommand));
}
/* command to associate sequences with table */ List *tableDDLCommands = GetFullTableCreationCommands(relationId,
List *sequenceDependencyCommandList = SequenceDependencyCommandList(relationId); includeSequenceDefaults);
commandList = list_concat(commandList, sequenceDependencyCommandList); TableDDLCommand *tableDDLCommand = NULL;
foreach_ptr(tableDDLCommand, tableDDLCommands)
{
Assert(CitusIsA(tableDDLCommand, TableDDLCommand));
commandList = lappend(commandList, GetTableDDLCommand(tableDDLCommand));
}
/* prevent recursive propagation */ /* command to associate sequences with table */
SendCommandToWorkersWithMetadata(DISABLE_DDL_PROPAGATION); List *sequenceDependencyCommandList = SequenceDependencyCommandList(relationId);
commandList = list_concat(commandList, sequenceDependencyCommandList);
/* send the commands one by one */ /* prevent recursive propagation */
const char *command = NULL; SendCommandToWorkersWithMetadata(DISABLE_DDL_PROPAGATION);
foreach_ptr(command, commandList)
{ const char *command = NULL;
SendCommandToWorkersWithMetadata(command); foreach_ptr(command, commandList)
} {
SendCommandToWorkersWithMetadata(command);
} }
} }