Changeset: 53bce3b9191d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/53bce3b9191d
Added Files:
sql/test/BugTracker-2025/Tests/7768-not-in.test
Modified Files:
sql/backends/monet5/rel_bin.c
sql/test/BugTracker-2025/Tests/All
Branch: Dec2025
Log Message:
small fix for bug #7768, ie also take anti flag into account for not-in
handling.
diffs (54 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
@@ -1996,7 +1996,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
return s;
}
if (e->flag == cmp_in || e->flag == cmp_notin)
- return handle_in_exps(be, e->l, e->r, left, right, grp,
ext, cnt, sel, (e->flag == cmp_in), depth, reduce, push);
+ return handle_in_exps(be, e->l, e->r, left, right, grp,
ext, cnt, sel, (e->flag == cmp_in)^is_anti(e), depth, reduce, push);
if (e->flag == cmp_con)
return exp_bin_conjunctive(be, e, left, right, grp,
ext, cnt, sel, depth, reduce, push);
if (e->flag == cmp_dis)
diff --git a/sql/test/BugTracker-2025/Tests/7768-not-in.test
b/sql/test/BugTracker-2025/Tests/7768-not-in.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2025/Tests/7768-not-in.test
@@ -0,0 +1,29 @@
+statement ok
+create table test (test_col varchar(1))
+
+statement ok rowcount 4
+insert into test values('a'),('b'),('c'),('d');
+
+query T
+select * from test where not (test_col in ('a','b'))
+----
+c
+d
+
+query T
+select * from test where (1 = 1) and not (test_col in ('a','b'))
+----
+c
+d
+
+query T
+select * from test where (1 <> 1) or not (test_col in ('a','b'))
+----
+c
+d
+
+query T
+select * from test where (1 <> 1) or (not (test_col in ('a','b')));
+----
+c
+d
diff --git a/sql/test/BugTracker-2025/Tests/All
b/sql/test/BugTracker-2025/Tests/All
--- a/sql/test/BugTracker-2025/Tests/All
+++ b/sql/test/BugTracker-2025/Tests/All
@@ -84,3 +84,4 @@ 7756-anti-join-null
7759-replace-wrong-error
7763-exits-with-null
7760-groupby_posarg_CP
+7768-not-in
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]