not using GPC when a GTT is used

This commit is contained in:
gentle_hu 2021-09-18 15:01:03 +08:00
parent bab3e083eb
commit 758ff6a46c
1 changed files with 3 additions and 1 deletions

View File

@ -390,12 +390,14 @@ void pgxc_handle_unsupported_stmts(Query* query)
bool contains_temp_tables(List* rtable)
{
ListCell* item = NULL;
char rel_persistence;
foreach (item, rtable) {
RangeTblEntry* rte = (RangeTblEntry*)lfirst(item);
if (rte->rtekind == RTE_RELATION) {
if (IsTempTable(rte->relid))
rel_persistence = get_rel_persistence(rte->relid);
if (rel_persistence == RELPERSISTENCE_TEMP || rel_persistence == RELPERSISTENCE_GLOBAL_TEMP)
return true;
} else if (rte->rtekind == RTE_SUBQUERY && contains_temp_tables(rte->subquery->rtable))
return true;