mirror of https://github.com/citusdata/citus.git
Fixes runtime errors
parent
a1ab60f5ad
commit
3dd4735e6e
|
@ -77,7 +77,6 @@ typedef struct DatabaseCollationInfo
|
|||
#endif
|
||||
} DatabaseCollationInfo;
|
||||
|
||||
static void EnsureSupportedCreateDatabaseCommand(CreatedbStmt *stmt);
|
||||
static char * GenerateCreateDatabaseStatementFromPgDatabase(Form_pg_database
|
||||
databaseForm);
|
||||
static DatabaseCollationInfo GetDatabaseCollation(Oid dbOid);
|
||||
|
|
|
@ -155,7 +155,6 @@ static char * RemoteSchemaIdExpressionByName(char *schemaName);
|
|||
static char * RemoteTypeIdExpression(Oid typeId);
|
||||
static char * RemoteCollationIdExpression(Oid colocationId);
|
||||
static char * RemoteTableIdExpression(Oid relationId);
|
||||
static void SendDatabaseGrantSyncCommands(MetadataSyncContext *context);
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(start_metadata_sync_to_all_nodes);
|
||||
|
@ -4666,13 +4665,6 @@ PropagateNodeWideObjectsCommandList(void)
|
|||
ddlCommands = list_concat(ddlCommands, alterRoleSetCommands);
|
||||
}
|
||||
|
||||
if (EnableCreateDatabasePropagation)
|
||||
{
|
||||
/* get commands for database creation */
|
||||
List *createDatabaseCommands = GenerateCreateDatabaseCommandList();
|
||||
ddlCommands = list_concat(ddlCommands, createDatabaseCommands);
|
||||
}
|
||||
|
||||
return ddlCommands;
|
||||
}
|
||||
|
||||
|
@ -4745,12 +4737,7 @@ SyncDistributedObjects(MetadataSyncContext *context)
|
|||
*/
|
||||
SendInterTableRelationshipCommands(context);
|
||||
|
||||
/*
|
||||
* After creation of databases and roles, send the grant database commands
|
||||
* to the workers.
|
||||
*/
|
||||
|
||||
SendDatabaseGrantSyncCommands(context);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4775,35 +4762,6 @@ SendNodeWideObjectsSyncCommands(MetadataSyncContext *context)
|
|||
SendOrCollectCommandListToActivatedNodes(context, commandList);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SendDatabaseGrantSyncCommands sends database grants to roles to workers with
|
||||
* transactional or nontransactional mode according to transactionMode inside
|
||||
* metadataSyncContext in case of EnableCreateDatabasePropagation GUC set.
|
||||
* This function is called after SendNodeWideObjectsSyncCommands and SendDependencyCreationCommands
|
||||
* because we need both databases and roles to be created on the worker.
|
||||
*
|
||||
*/
|
||||
static void
|
||||
SendDatabaseGrantSyncCommands(MetadataSyncContext *context)
|
||||
{
|
||||
if (EnableCreateDatabasePropagation)
|
||||
{
|
||||
/* propagate node wide objects. It includes only roles for now. */
|
||||
List *commandList = GenerateGrantDatabaseCommandList();
|
||||
|
||||
if (commandList == NIL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
commandList = lcons(DISABLE_DDL_PROPAGATION, commandList);
|
||||
commandList = lappend(commandList, ENABLE_DDL_PROPAGATION);
|
||||
SendOrCollectCommandListToActivatedNodes(context, commandList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SendShellTableDeletionCommands sends sequence, and shell table deletion
|
||||
* commands to workers with transactional or nontransactional mode according to
|
||||
|
|
|
@ -243,7 +243,6 @@ extern List * DropDatabaseStmtObjectAddress(Node *node, bool missingOk,
|
|||
bool isPostprocess);
|
||||
extern List * CreateDatabaseStmtObjectAddress(Node *node, bool missingOk,
|
||||
bool isPostprocess);
|
||||
extern List * GenerateCreateDatabaseCommandList(void);
|
||||
extern List * GenerateGrantDatabaseCommandList(void);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue