Changeset: f07f6ca6ea68 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f07f6ca6ea68
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

fixes for issue #7938. The first (n) expressions got lost in case of negated 
conjuctive expressions used as input predicate to some other expression (here a 
case when).


diffs (28 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -714,10 +714,13 @@ exp_bin_conjunctive(backend *be, sql_exp
                        sql_subfunc *f = sql_bind_func(be->mvc, "sys", 
anti?"or":"and", bt, bt, F_FUNC, true, true);
                        assert(f);
                        s = stmt_binop(be, sin, s, NULL, f);
-               } else if (!reduce && !sin && sel1 && sel1->nrcols == 0) {
+               } else if (!reduce && !sin && sel1) {
                        sql_subfunc *f = sql_bind_func(be->mvc, "sys", 
anti?"or":"and", bt, bt, F_FUNC, true, true);
                        assert(f);
-                       s = stmt_binop(be, sel1, s, sin, f);
+                       if (sel1->nrcols == 0)
+                               s = stmt_binop(be, sel1, s, sin, f);
+                       else
+                               s = stmt_binop(be, s, sel1, sin, f);
                } else if (reduce && ((sel1 && (sel1->nrcols == 0 || s->nrcols 
== 0)) || c->type != e_cmp)) {
                        if (s->nrcols) {
                                if (sel1 && (sel1->nrcols == 0 || s->nrcols == 
0)) {
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
@@ -129,4 +129,4 @@ KNOWNFAIL?7931-rel2bin_select-assertion-
 7933-query-without-result-bug
 7934-ALGouterselect-assertion-failure
 KNOWNFAIL?7937-where-not-in-values-null-bug
-KNOWNFAIL?7938-not-x-is-const-and-x-is-not-null-bug
+7938-not-x-is-const-and-x-is-not-null-bug
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to