Changeset: 3595a2cb676b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3595a2cb676b
Modified Files:
        sql/server/rel_unnest.c
        
sql/test/BugTracker-2026/Tests/7876-rel2bin_select-assertion-failure.test
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

fix for issue #7876, ie dont push up a select out of group join


diffs (73 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -754,6 +754,10 @@ move_join_exps(mvc *sql, sql_rel *j, sql
        node *n;
        list *exps = rel->exps;
 
+       if (j->attr && exps_uses_exp(rel->exps, j->attr->h->data)) {
+               assert(0);
+       }
+
        if (list_empty(exps))
                return;
        rel->exps = sa_list(sql->sa);
@@ -1177,7 +1181,7 @@ push_up_select(mvc *sql, sql_rel *rel, l
        if (inner && is_left(rel->op) && !need_distinct(d))
                return rel_general_unnest(sql, rel, ad);
        /* input rel is dependent join with on the right a select */
-       if ((!inner || is_semi(rel->op)) && rel && is_dependent(rel)) {
+       if ((!inner || is_semi(rel->op) || (is_left(rel->op) && 
!list_empty(rel->attr))) && rel && is_dependent(rel)) {
                sql_rel *r = rel->r;
 
                if (r && is_select(r->op)) { /* move into join */
diff --git 
a/sql/test/BugTracker-2026/Tests/7876-rel2bin_select-assertion-failure.test 
b/sql/test/BugTracker-2026/Tests/7876-rel2bin_select-assertion-failure.test
--- a/sql/test/BugTracker-2026/Tests/7876-rel2bin_select-assertion-failure.test
+++ b/sql/test/BugTracker-2026/Tests/7876-rel2bin_select-assertion-failure.test
@@ -111,6 +111,34 @@ ON (
 WHERE ref_0.score IS NULL
 LIMIT 95
 ----
+NULL
+NULL
+NULL
+carol
+2022-01-03 12:00:00
+NULL
+Empty
+NULL
+NULL
+NULL
+carol
+2022-01-03 12:00:00
+NULL
+First post
+NULL
+NULL
+NULL
+carol
+2022-01-03 12:00:00
+NULL
+Last
+NULL
+NULL
+NULL
+carol
+2022-01-03 12:00:00
+NULL
+banned
 
 statement ok
 DROP TABLE orders
diff --git a/sql/test/BugTracker-2026/Tests/All 
b/sql/test/BugTracker-2026/Tests/All
--- a/sql/test/BugTracker-2026/Tests/All
+++ b/sql/test/BugTracker-2026/Tests/All
@@ -66,7 +66,7 @@ KNOWNFAIL?7774-insert-into-renamed-table
 7873-push_up_join-assertion-failure
 7874-rel2bin_join-assertion-failure
 KNOWNFAIL?7875-rel2bin_groupjoin-assertion-failure
-KNOWNFAIL?7876-rel2bin_select-assertion-failure
+7876-rel2bin_select-assertion-failure
 7877-push_up_join-assertion-failure
 7878-exp_bin-assertion-failure
 7879-crash
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to