From c4ec73409f09aebdc43c2a9820792ad432be0557 Mon Sep 17 00:00:00 2001 From: Man Zeng Date: Fri, 20 Mar 2026 21:59:25 +0800 Subject: [PATCH] Correcting the value of rte->inFromCl in (SQL/PGQ) Setting it to false in the commit statement 2f094e7ac691abc9d2fe0f4dcf0feac4a6ce1d9c is incorrect. It should actually be set to true to ensure an equivalent SQL statement is obtained. --- contrib/pg_overexplain/expected/pg_overexplain.out | 4 ++-- src/backend/rewrite/rewriteGraphTable.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/pg_overexplain/expected/pg_overexplain.out b/contrib/pg_overexplain/expected/pg_overexplain.out index 05c6686d677..f4ad26df1ae 100644 --- a/contrib/pg_overexplain/expected/pg_overexplain.out +++ b/contrib/pg_overexplain/expected/pg_overexplain.out @@ -649,14 +649,14 @@ SELECT * FROM GRAPH_TABLE (vegetables_graph MATCH (v1 IS vegetables) WHERE v1.ge RTI 3 (subquery): Eref: unnamed_subquery (name) Lateral: true - RTI 4 (relation): + RTI 4 (relation, in-from-clause): Subplan: unnamed_subquery Eref: daucus (id, name, genus) Relation: daucus Relation Kind: relation Relation Lock Mode: AccessShareLock Permission Info Index: 2 - RTI 5 (relation): + RTI 5 (relation, in-from-clause): Subplan: unnamed_subquery_1 Eref: brassica (id, name, genus) Relation: brassica diff --git a/src/backend/rewrite/rewriteGraphTable.c b/src/backend/rewrite/rewriteGraphTable.c index 06f2f3442d8..d43704ef233 100644 --- a/src/backend/rewrite/rewriteGraphTable.c +++ b/src/backend/rewrite/rewriteGraphTable.c @@ -498,7 +498,7 @@ generate_query_for_graph_path(RangeTblEntry *rte, List *graph_path) */ rel = table_open(pe->reloid, AccessShareLock); pni = addRangeTableEntryForRelation(make_parsestate(NULL), rel, AccessShareLock, - NULL, true, false); + NULL, true, true); table_close(rel, NoLock); path_query->rtable = lappend(path_query->rtable, pni->p_rte); path_query->rteperminfos = lappend(path_query->rteperminfos, pni->p_perminfo); -- 2.45.2