Move InTableTypeConversionFunctionCall to conversion func

velioglu/prop_dep_view_review
Ahmet Gedemenli 2022-05-24 14:31:12 +03:00
parent 774befda9c
commit bbc1d1797b
3 changed files with 8 additions and 5 deletions

View File

@ -768,10 +768,7 @@ PreprocessAlterTableStmt(Node *node, const char *alterTableCommand,
* experience by asking to add coordinator to metadata.
*/
/* as we're having a table type conversion, dont need warning messages */
InTableTypeConversionFunctionCall = true;
ConvertPostgresLocalTablesToCitusLocalTables(alterTableStatement);
InTableTypeConversionFunctionCall = false;
/*
* CreateCitusLocalTable converts relation to a shard relation and creates
@ -1272,6 +1269,9 @@ RelationIdListContainsPostgresTable(List *relationIdList)
static void
ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement)
{
/* as we're having a table type conversion, dont need warning messages */
InTableTypeConversionFunctionCall = true;
List *rightRelationRangeVarList =
GetAlterTableAddFKeyRightRelationRangeVarList(alterTableStatement);
RangeVar *leftRelationRangeVar = alterTableStatement->relation;
@ -1387,6 +1387,7 @@ ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement
}
PG_CATCH();
{
InTableTypeConversionFunctionCall = false;
MemoryContextSwitchTo(savedMemoryContext);
ErrorData *errorData = CopyErrorData();
@ -1405,6 +1406,8 @@ ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement
}
PG_END_TRY();
}
InTableTypeConversionFunctionCall = false;
}

View File

@ -596,7 +596,7 @@ create view dependent_view_1 as select count(*) from table_to_depend_on_1;
WARNING: "view dependent_view_1" has dependency to "table table_to_depend_on_1" that is not in Citus' metadata
DETAIL: "view dependent_view_1" will be created only locally
HINT: Distribute "table table_to_depend_on_1" first to distribute "view dependent_view_1"
-- the seconds view depends on two tables
-- the second view depends on two tables
create view dependent_view_2 as select count(*) from table_to_depend_on_1 join table_to_depend_on_2 on table_to_depend_on_1.a=table_to_depend_on_2.a;
WARNING: "view dependent_view_2" has dependency to "table table_to_depend_on_2" that is not in Citus' metadata
DETAIL: "view dependent_view_2" will be created only locally

View File

@ -379,7 +379,7 @@ create table table_to_depend_on_1 (a int);
create table table_to_depend_on_2 (a int);
-- the first view depends on a table
create view dependent_view_1 as select count(*) from table_to_depend_on_1;
-- the seconds view depends on two tables
-- the second view depends on two tables
create view dependent_view_2 as select count(*) from table_to_depend_on_1 join table_to_depend_on_2 on table_to_depend_on_1.a=table_to_depend_on_2.a;
-- distribute only one table
select create_distributed_table('table_to_depend_on_1','a');