mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Fix buggy recursion in flatten_rtes_walker().
Must save-and-restore the context we are modifying.
Oversight in commit a61b1f748
.
Tender Wang
Discussion: https://postgr.es/m/CAHewXNnnNySD_YcKNuFpQDV2gxWA7_YLWqHmYVcyoOYxn8kY2A@mail.gmail.com
Discussion: https://postgr.es/m/20230212233711.GA1316@telsasoft.com
This commit is contained in:
@ -536,11 +536,16 @@ flatten_rtes_walker(Node *node, flatten_rtes_walker_context *cxt)
|
||||
* Recurse into subselects. Must update cxt->query to this query so
|
||||
* that the rtable and rteperminfos correspond with each other.
|
||||
*/
|
||||
Query *save_query = cxt->query;
|
||||
bool result;
|
||||
|
||||
cxt->query = (Query *) node;
|
||||
return query_tree_walker((Query *) node,
|
||||
flatten_rtes_walker,
|
||||
(void *) cxt,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
result = query_tree_walker((Query *) node,
|
||||
flatten_rtes_walker,
|
||||
(void *) cxt,
|
||||
QTW_EXAMINE_RTES_BEFORE);
|
||||
cxt->query = save_query;
|
||||
return result;
|
||||
}
|
||||
return expression_tree_walker(node, flatten_rtes_walker,
|
||||
(void *) cxt);
|
||||
|
Reference in New Issue
Block a user