Commit be87143f authored by Tom Lane's avatar Tom Lane

Fix bogus range_table_mutator() logic for RangeTblEntry.tablesample.

Must make a copy of the TableSampleClause node; the previous coding
modified the input data structure in-place.

Petr Jelinek
parent ed16f73c
......@@ -2870,10 +2870,14 @@ range_table_mutator(List *rtable,
case RTE_RELATION:
if (rte->tablesample)
{
MUTATE(rte->tablesample->args, rte->tablesample->args,
CHECKFLATCOPY(newrte->tablesample, rte->tablesample,
TableSampleClause);
MUTATE(newrte->tablesample->args,
newrte->tablesample->args,
List *);
MUTATE(rte->tablesample->repeatable,
rte->tablesample->repeatable, Node *);
MUTATE(newrte->tablesample->repeatable,
newrte->tablesample->repeatable,
Node *);
}
break;
case RTE_CTE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment