mirror of https://github.com/citusdata/citus.git
fixup! Handle ADD FKEY commands in preprocess
parent
487ce8fce0
commit
f3f650c0b7
|
@ -55,8 +55,9 @@ static void ErrorIfAlterTableDefinesFKeyFromPostgresToCitusLocalTable(
|
||||||
static List * GetAlterTableStmtFKeyConstraintList(AlterTableStmt *alterTableStatement);
|
static List * GetAlterTableStmtFKeyConstraintList(AlterTableStmt *alterTableStatement);
|
||||||
static List * GetAlterTableCommandFKeyConstraintList(AlterTableCmd *command);
|
static List * GetAlterTableCommandFKeyConstraintList(AlterTableCmd *command);
|
||||||
static bool AlterTableCommandTypeIsTrigger(AlterTableType alterTableType);
|
static bool AlterTableCommandTypeIsTrigger(AlterTableType alterTableType);
|
||||||
static bool AlterTableHasCommandByFunc(AlterTableStmt *alterTableStatement,
|
static bool FindAlterTableCmdMatchingCheckFunction(AlterTableStmt *alterTableStatement,
|
||||||
AlterTableCommandFunc alterTableCommandFunc);
|
AlterTableCommandFunc
|
||||||
|
alterTableCommandFunc);
|
||||||
static bool AlterTableCmdAddsOrDropsFkey(AlterTableCmd *command, Oid relationId);
|
static bool AlterTableCmdAddsOrDropsFkey(AlterTableCmd *command, Oid relationId);
|
||||||
static bool AlterTableCmdAddsFKey(AlterTableCmd *command, Oid relationId);
|
static bool AlterTableCmdAddsFKey(AlterTableCmd *command, Oid relationId);
|
||||||
static bool AlterTableCmdDropsFkey(AlterTableCmd *command, Oid relationId);
|
static bool AlterTableCmdDropsFkey(AlterTableCmd *command, Oid relationId);
|
||||||
|
@ -408,7 +409,8 @@ PreprocessAlterTableStmt(Node *node, const char *alterTableCommand)
|
||||||
*/
|
*/
|
||||||
ErrorIfAlterTableDefinesFKeyFromPostgresToCitusLocalTable(alterTableStatement);
|
ErrorIfAlterTableDefinesFKeyFromPostgresToCitusLocalTable(alterTableStatement);
|
||||||
|
|
||||||
if (AlterTableHasCommandByFunc(alterTableStatement, AlterTableCmdAddsOrDropsFkey))
|
if (FindAlterTableCmdMatchingCheckFunction(alterTableStatement,
|
||||||
|
AlterTableCmdAddsOrDropsFkey))
|
||||||
{
|
{
|
||||||
MarkInvalidateForeignKeyGraph();
|
MarkInvalidateForeignKeyGraph();
|
||||||
}
|
}
|
||||||
|
@ -998,12 +1000,12 @@ PostprocessAlterTableStmt(AlterTableStmt *alterTableStatement)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AlterTableHasCommandByFunc returns true if given alterTableCommandFunc returns
|
* FindAlterTableCmdMatchingCheckFunction returns true if given alterTableCommandFunc
|
||||||
* true for any subcommand of alterTableStatement.
|
* returns true for any subcommand of alterTableStatement.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
AlterTableHasCommandByFunc(AlterTableStmt *alterTableStatement,
|
FindAlterTableCmdMatchingCheckFunction(AlterTableStmt *alterTableStatement,
|
||||||
AlterTableCommandFunc alterTableCommandFunc)
|
AlterTableCommandFunc alterTableCommandFunc)
|
||||||
{
|
{
|
||||||
List *commandList = alterTableStatement->cmds;
|
List *commandList = alterTableStatement->cmds;
|
||||||
AlterTableCmd *command = NULL;
|
AlterTableCmd *command = NULL;
|
||||||
|
|
Loading…
Reference in New Issue