Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit be87143

Browse files
committed
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
1 parent ed16f73 commit be87143

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/backend/nodes/nodeFuncs.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -2870,10 +2870,14 @@ range_table_mutator(List *rtable,
28702870
case RTE_RELATION:
28712871
if (rte->tablesample)
28722872
{
2873-
MUTATE(rte->tablesample->args, rte->tablesample->args,
2873+
CHECKFLATCOPY(newrte->tablesample, rte->tablesample,
2874+
TableSampleClause);
2875+
MUTATE(newrte->tablesample->args,
2876+
newrte->tablesample->args,
28742877
List *);
2875-
MUTATE(rte->tablesample->repeatable,
2876-
rte->tablesample->repeatable, Node *);
2878+
MUTATE(newrte->tablesample->repeatable,
2879+
newrte->tablesample->repeatable,
2880+
Node *);
28772881
}
28782882
break;
28792883
case RTE_CTE:

0 commit comments

Comments
 (0)