Changeset: 26cf0295b8d3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=26cf0295b8d3
Modified Files:
        monetdb5/modules/kernel/algebra.c
        
sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
Branch: Nov2019
Log Message:

small fix for corner case (not) between null and null


diffs (49 lines):

diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -285,6 +285,7 @@ ALGselect2nil(bat *result, const bat *bi
 {
        BAT *b, *s = NULL, *bn;
        const void *nilptr;
+       bit nanti = *anti;
 
        if (!*unknown)
                return ALGselect2(result, bid, sid, low, high, li, hi, anti);
@@ -309,7 +310,9 @@ ALGselect2nil(bat *result, const bat *bi
                low = high; 
        else if (*hi == 1 && ATOMcmp(b->ttype, high, nilptr) == 0)
                high = low;
-       bn = BATselect(b, s, low, high, *li, *hi, *anti);
+       if (low == high && ATOMcmp(b->ttype, high, nilptr) == 0) /* ugh sql nil 
!= nil */
+               nanti = !nanti;
+       bn = BATselect(b, s, low, high, *li, *hi, nanti);
        BBPunfix(b->batCacheid);
        if (s)
                BBPunfix(s->batCacheid);
diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
@@ -63,6 +63,23 @@ stdout of test 'sqlitelogictest-having-n
 % bigint # type
 % 1 # length
 [ 0    ]
+#SELECT ALL * FROM tab0 AS cor0 WHERE col2 BETWEEN NULL AND NULL; --empty
+% sys.cor0,    sys.cor0,       sys.cor0 # table_name
+% col0,        col1,   col2 # name
+% int, int,    int # type
+% 1,   1,      1 # length
+#SELECT COUNT ( * ) FROM tab0 WHERE NOT col1 NOT BETWEEN NULL AND NULL; --0
+% sys.L2 # table_name
+% L2 # name
+% bigint # type
+% 1 # length
+[ 0    ]
+#SELECT - 78 * + MAX ( DISTINCT col2 ) + - 52 AS col1 FROM tab0 AS cor0 WHERE 
NOT - col0 + col2 NOT BETWEEN ( NULL ) AND NULL; --NULL
+% sys.L3 # table_name
+% col1 # name
+% bigint # type
+% 1 # length
+[ NULL ]
 #DROP TABLE tab0;
 
 # 12:32:58 >  
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to