This is an automated email from the ASF dual-hosted git repository.

chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new 0a0521e9273 Fix copyfunc for place holder var
0a0521e9273 is described below

commit 0a0521e9273876304b0a2dde2c552121d8fda393
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Nov 20 10:28:35 2025 +0800

    Fix copyfunc for place holder var
---
 src/backend/nodes/copyfuncs.c        |  1 +
 src/backend/optimizer/plan/setrefs.c | 18 +++++++++---------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 033574274e5..ec16a091002 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -2989,6 +2989,7 @@ _copyPlaceHolderVar(const PlaceHolderVar *from)
 
        COPY_NODE_FIELD(phexpr);
        COPY_BITMAPSET_FIELD(phrels);
+       COPY_BITMAPSET_FIELD(phnullingrels);
        COPY_SCALAR_FIELD(phid);
        COPY_SCALAR_FIELD(phlevelsup);
 
diff --git a/src/backend/optimizer/plan/setrefs.c 
b/src/backend/optimizer/plan/setrefs.c
index 4788748217e..0bf59d7c756 100644
--- a/src/backend/optimizer/plan/setrefs.c
+++ b/src/backend/optimizer/plan/setrefs.c
@@ -3383,15 +3383,15 @@ search_indexed_tlist_for_phv(PlaceHolderVar *phv,
                                continue;
 
                        /* Verify that we kept all the nullingrels machinations 
straight */
-//                     if (!(nrm_match == NRM_SUBSET ?
-//                               bms_is_subset(phv->phnullingrels, 
subphv->phnullingrels) :
-//                               nrm_match == NRM_SUPERSET ?
-//                               bms_is_subset(subphv->phnullingrels, 
phv->phnullingrels) :
-//                               bms_equal(subphv->phnullingrels, 
phv->phnullingrels)))
-//                             elog(ERROR, "wrong phnullingrels %s (expected 
%s) for PlaceHolderVar %d",
-//                                      bmsToString(phv->phnullingrels),
-//                                      bmsToString(subphv->phnullingrels),
-//                                      phv->phid);
+                       if (!(nrm_match == NRM_SUBSET ?
+                                 bms_is_subset(phv->phnullingrels, 
subphv->phnullingrels) :
+                                 nrm_match == NRM_SUPERSET ?
+                                 bms_is_subset(subphv->phnullingrels, 
phv->phnullingrels) :
+                                 bms_equal(subphv->phnullingrels, 
phv->phnullingrels)))
+                               elog(ERROR, "wrong phnullingrels %s (expected 
%s) for PlaceHolderVar %d",
+                                        bmsToString(phv->phnullingrels),
+                                        bmsToString(subphv->phnullingrels),
+                                        phv->phid);
 
                        /* Found a matching subplan output expression */
                        newvar = makeVarFromTargetEntry(newvarno, tle);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to