Changeset: 49db804b82e9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/49db804b82e9
Added Files:
        sql/test/BugTracker-2024/Tests/All
        sql/test/BugTracker-2024/Tests/SingleServer
        sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test
Modified Files:
        sql/backends/monet5/rel_bin.c
Branch: Dec2023
Log Message:

added test for issue 7426.
In case of anti select, don't use the hash index


diffs (59 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
@@ -4333,7 +4333,7 @@ rel2bin_select(backend *be, sql_rel *rel
                sql_exp *e = en->data;
                prop *p;
 
-               if ((p=find_prop(e->p, PROP_HASHCOL)) != NULL) {
+               if ((p=find_prop(e->p, PROP_HASHCOL)) != NULL && !is_anti(e)) {
                        sql_idx *i = p->value.pval;
                        int oldvtop = be->mb->vtop, oldstop = be->mb->stop, 
oldvid = be->mb->vid;
 
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -0,0 +1,1 @@
+inequality-hash-issue-7426
diff --git a/sql/test/BugTracker-2024/Tests/SingleServer 
b/sql/test/BugTracker-2024/Tests/SingleServer
new file mode 100644
diff --git a/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test 
b/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test
@@ -0,0 +1,34 @@
+
+statement ok
+CREATE TABLE t1(c1 INTEGER)
+
+statement ok
+CREATE TABLE t0(c0 BOOL, c1 INTEGER)
+
+statement ok
+INSERT INTO t1 (c1) VALUES (0)
+
+statement ok
+CREATE UNIQUE INDEX i0 ON t0(c1 , c0 )
+
+statement ok
+INSERT INTO t0 (c0, c1) VALUES (true, 0)
+
+query III
+SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER JOIN t0 ON t0.c0
+----
+1
+0
+0
+
+query I
+SELECT (t0.c1) IS NOT NULL FROM t1 INNER  JOIN t0 ON t0.c0
+----
+1
+
+query III
+SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER  JOIN t0 ON t0.c0 WHERE (t0.c1) IS 
NOT NULL
+----
+1
+0
+0
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to