mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
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
This commit is contained in:
@ -2870,10 +2870,14 @@ range_table_mutator(List *rtable,
|
|||||||
case RTE_RELATION:
|
case RTE_RELATION:
|
||||||
if (rte->tablesample)
|
if (rte->tablesample)
|
||||||
{
|
{
|
||||||
MUTATE(rte->tablesample->args, rte->tablesample->args,
|
CHECKFLATCOPY(newrte->tablesample, rte->tablesample,
|
||||||
|
TableSampleClause);
|
||||||
|
MUTATE(newrte->tablesample->args,
|
||||||
|
newrte->tablesample->args,
|
||||||
List *);
|
List *);
|
||||||
MUTATE(rte->tablesample->repeatable,
|
MUTATE(newrte->tablesample->repeatable,
|
||||||
rte->tablesample->repeatable, Node *);
|
newrte->tablesample->repeatable,
|
||||||
|
Node *);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RTE_CTE:
|
case RTE_CTE:
|
||||||
|
Reference in New Issue
Block a user