mirror of https://github.com/citusdata/citus.git
extract schema DistributeObjectOps
parent
91e01a657b
commit
4ca33dde64
|
@ -99,24 +99,6 @@ static DistributeObjectOps Collation_Rename = {
|
||||||
REGISTER_DISTRIBUTED_OPERATION_NESTED(RenameStmt, renameType, OBJECT_COLLATION,
|
REGISTER_DISTRIBUTED_OPERATION_NESTED(RenameStmt, renameType, OBJECT_COLLATION,
|
||||||
Collation_Rename);
|
Collation_Rename);
|
||||||
|
|
||||||
static DistributeObjectOps Schema_Drop = {
|
|
||||||
.deparse = NULL,
|
|
||||||
.qualify = NULL,
|
|
||||||
.preprocess = PreprocessDropSchemaStmt,
|
|
||||||
.postprocess = NULL,
|
|
||||||
.address = NULL,
|
|
||||||
};
|
|
||||||
REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_SCHEMA, Schema_Drop);
|
|
||||||
|
|
||||||
static DistributeObjectOps Schema_Grant = {
|
|
||||||
.deparse = DeparseGrantOnSchemaStmt,
|
|
||||||
.qualify = NULL,
|
|
||||||
.preprocess = PreprocessGrantOnSchemaStmt,
|
|
||||||
.postprocess = NULL,
|
|
||||||
.address = NULL,
|
|
||||||
};
|
|
||||||
REGISTER_DISTRIBUTED_OPERATION_NESTED(GrantStmt, objtype, OBJECT_SCHEMA, Schema_Grant);
|
|
||||||
|
|
||||||
/* linker provided pointers */
|
/* linker provided pointers */
|
||||||
SECTION_ARRAY(DistributedObjectOpsContainer *, opscontainer);
|
SECTION_ARRAY(DistributedObjectOpsContainer *, opscontainer);
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,33 @@
|
||||||
static List * FilterDistributedSchemas(List *schemas);
|
static List * FilterDistributedSchemas(List *schemas);
|
||||||
|
|
||||||
|
|
||||||
|
/* DistributeObjectOps */
|
||||||
|
static List * PreprocessDropSchemaStmt(Node *node, const char *queryString);
|
||||||
|
static DistributeObjectOps Schema_Drop = {
|
||||||
|
.deparse = NULL,
|
||||||
|
.qualify = NULL,
|
||||||
|
.preprocess = PreprocessDropSchemaStmt,
|
||||||
|
.postprocess = NULL,
|
||||||
|
.address = NULL,
|
||||||
|
};
|
||||||
|
REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_SCHEMA, Schema_Drop);
|
||||||
|
|
||||||
|
static List * PreprocessGrantOnSchemaStmt(Node *node, const char *queryString);
|
||||||
|
static DistributeObjectOps Schema_Grant = {
|
||||||
|
.deparse = DeparseGrantOnSchemaStmt,
|
||||||
|
.qualify = NULL,
|
||||||
|
.preprocess = PreprocessGrantOnSchemaStmt,
|
||||||
|
.postprocess = NULL,
|
||||||
|
.address = NULL,
|
||||||
|
};
|
||||||
|
REGISTER_DISTRIBUTED_OPERATION_NESTED(GrantStmt, objtype, OBJECT_SCHEMA, Schema_Grant);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PreprocessDropSchemaStmt invalidates the foreign key cache if any table created
|
* PreprocessDropSchemaStmt invalidates the foreign key cache if any table created
|
||||||
* under dropped schema involved in any foreign key relationship.
|
* under dropped schema involved in any foreign key relationship.
|
||||||
*/
|
*/
|
||||||
List *
|
static List *
|
||||||
PreprocessDropSchemaStmt(Node *node, const char *queryString)
|
PreprocessDropSchemaStmt(Node *node, const char *queryString)
|
||||||
{
|
{
|
||||||
DropStmt *dropStatement = castNode(DropStmt, node);
|
DropStmt *dropStatement = castNode(DropStmt, node);
|
||||||
|
@ -119,7 +141,7 @@ PreprocessDropSchemaStmt(Node *node, const char *queryString)
|
||||||
* In this stage we can prepare the commands that need to be run on all workers to grant
|
* In this stage we can prepare the commands that need to be run on all workers to grant
|
||||||
* on schemas. Only grant statements for distributed schema are propagated.
|
* on schemas. Only grant statements for distributed schema are propagated.
|
||||||
*/
|
*/
|
||||||
List *
|
static List *
|
||||||
PreprocessGrantOnSchemaStmt(Node *node, const char *queryString)
|
PreprocessGrantOnSchemaStmt(Node *node, const char *queryString)
|
||||||
{
|
{
|
||||||
GrantStmt *stmt = castNode(GrantStmt, node);
|
GrantStmt *stmt = castNode(GrantStmt, node);
|
||||||
|
|
|
@ -197,14 +197,6 @@ extern List * PreprocessRenameAttributeStmt(Node *stmt, const char *queryString)
|
||||||
extern List * GenerateAlterRoleIfExistsCommandAllRoles(void);
|
extern List * GenerateAlterRoleIfExistsCommandAllRoles(void);
|
||||||
|
|
||||||
|
|
||||||
/* schema.c - forward declarations */
|
|
||||||
extern List * PreprocessDropSchemaStmt(Node *dropSchemaStatement,
|
|
||||||
const char *queryString);
|
|
||||||
extern List * PreprocessAlterObjectSchemaStmt(Node *alterObjectSchemaStmt,
|
|
||||||
const char *alterObjectSchemaCommand);
|
|
||||||
extern List * PreprocessGrantOnSchemaStmt(Node *node, const char *queryString);
|
|
||||||
|
|
||||||
|
|
||||||
/* sequence.c - forward declarations */
|
/* sequence.c - forward declarations */
|
||||||
extern void ErrorIfUnsupportedSeqStmt(CreateSeqStmt *createSeqStmt);
|
extern void ErrorIfUnsupportedSeqStmt(CreateSeqStmt *createSeqStmt);
|
||||||
extern void ErrorIfDistributedAlterSeqOwnedBy(AlterSeqStmt *alterSeqStmt);
|
extern void ErrorIfDistributedAlterSeqOwnedBy(AlterSeqStmt *alterSeqStmt);
|
||||||
|
|
Loading…
Reference in New Issue