mirror of https://github.com/citusdata/citus.git
Postgres 18: Fix regress tests caused by GROUP RTE. (#8206)
The change in `merge_planner.c` fixes _unrecognized range table entry_ diffs in merge regress tests (category 2 diffs in #7992), the change in `multi_router_planner.c` fixes _column reference ... is ambiguous_ diffs in `multi_insert_select` and `multi_insert_select_window` (category 3 diffs in #7992). Edit to `common.py` enables standalone regress tests with pg18 (e..g `citus_tests/run_test.py merge`).pull/8201/head^2
parent
d2ea4043d4
commit
b5e70f56ab
|
|
@ -422,10 +422,13 @@ ErrorIfMergeHasUnsupportedTables(Oid targetRelationId, List *rangeTableList)
|
||||||
case RTE_VALUES:
|
case RTE_VALUES:
|
||||||
case RTE_JOIN:
|
case RTE_JOIN:
|
||||||
case RTE_CTE:
|
case RTE_CTE:
|
||||||
{
|
#if PG_VERSION_NUM >= PG_VERSION_18
|
||||||
/* Skip them as base table(s) will be checked */
|
case RTE_GROUP:
|
||||||
continue;
|
#endif
|
||||||
}
|
{
|
||||||
|
/* Skip them as base table(s) will be checked */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RTE_NAMEDTUPLESTORE is typically used in ephmeral named relations,
|
* RTE_NAMEDTUPLESTORE is typically used in ephmeral named relations,
|
||||||
|
|
|
||||||
|
|
@ -372,6 +372,25 @@ AddPartitionKeyNotNullFilterToSelect(Query *subqery)
|
||||||
/* we should have found target partition column */
|
/* we should have found target partition column */
|
||||||
Assert(targetPartitionColumnVar != NULL);
|
Assert(targetPartitionColumnVar != NULL);
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= PG_VERSION_18
|
||||||
|
if (subqery->hasGroupRTE)
|
||||||
|
{
|
||||||
|
/* if the partition column is a grouped column, we need to flatten it
|
||||||
|
* to ensure query deparsing works correctly. We choose to do this here
|
||||||
|
* instead of in ruletils.c because we want to keep the flattening logic
|
||||||
|
* close to the NOT NULL filter injection.
|
||||||
|
*/
|
||||||
|
RangeTblEntry *partitionRTE = rt_fetch(targetPartitionColumnVar->varno,
|
||||||
|
subqery->rtable);
|
||||||
|
if (partitionRTE->rtekind == RTE_GROUP)
|
||||||
|
{
|
||||||
|
targetPartitionColumnVar = (Var *) flatten_group_exprs(NULL, subqery,
|
||||||
|
(Node *)
|
||||||
|
targetPartitionColumnVar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* create expression for partition_column IS NOT NULL */
|
/* create expression for partition_column IS NOT NULL */
|
||||||
NullTest *nullTest = makeNode(NullTest);
|
NullTest *nullTest = makeNode(NullTest);
|
||||||
nullTest->nulltesttype = IS_NOT_NULL;
|
nullTest->nulltesttype = IS_NOT_NULL;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue