Changeset: 021999eef451 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=021999eef451
Added Files:
sql/test/BugTracker-2018/Tests/sqlitelogictest-not-between-wrong.Bug-6569.stable.err
sql/test/BugTracker-2018/Tests/sqlitelogictest-not-between-wrong.Bug-6569.stable.out
Modified Files:
gdk/gdk_select.c
monetdb5/modules/kernel/Tests/select.malC
monetdb5/modules/kernel/Tests/select.stable.out
Branch: Mar2018
Log Message:
An anti-select for an empty range should return all non-nil values.
This fixes bug 6569.
diffs (truncated from 507 to 300 lines):
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1330,6 +1330,18 @@ BATselect(BAT *b, BAT *s, const void *tl
s ? BATgetId(s) : "NULL",
s && BATtdense(s) ? "(dense)"
: "");
}
+ } else if (ATOMcmp(t, tl, th) > 0) {
+ /* empty range: turn into range select for
+ * nil-nil range (i.e. everything but nil) */
+ equi = 0;
+ anti = 0;
+ lval = 0;
+ hval = 0;
+ ALGODEBUG fprintf(stderr, "#BATselect(b=%s#" BUNFMT
+ ",s=%s%s,anti=0): anti-nil\n",
+ BATgetId(b), BATcount(b),
+ s ? BATgetId(s) : "NULL",
+ s && BATtdense(s) ? "(dense)" : "");
}
}
diff --git a/monetdb5/modules/kernel/Tests/select.malC
b/monetdb5/modules/kernel/Tests/select.malC
--- a/monetdb5/modules/kernel/Tests/select.malC
+++ b/monetdb5/modules/kernel/Tests/select.malC
@@ -247,23 +247,23 @@ io.print("nothing");
x := algebra.select(b, nil:bat[:oid], 7, 3, true, true, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(b, nil:bat[:oid], 7, 3, true, false, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(b, nil:bat[:oid], 7, 3, false, true, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(b, nil:bat[:oid], 7, 3, false, false, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
bat.orderidx(b,3);
@@ -497,23 +497,23 @@ io.print("nothing");
x := algebra.select(b, nil:bat[:oid], 7, 3, true, true, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(b, nil:bat[:oid], 7, 3, true, false, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(b, nil:bat[:oid], 7, 3, false, true, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(b, nil:bat[:oid], 7, 3, false, false, true);
z := algebra.projection(x, b);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(s, nil:bat[:oid], nil:int, nil:int, true, true, false);
@@ -744,23 +744,23 @@ io.print("nothing");
x := algebra.select(s, nil:bat[:oid], 7, 3, true, true, true);
z := algebra.projection(x, s);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(s, nil:bat[:oid], 7, 3, true, false, true);
z := algebra.projection(x, s);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(s, nil:bat[:oid], 7, 3, false, true, true);
z := algebra.projection(x, s);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(s, nil:bat[:oid], 7, 3, false, false, true);
z := algebra.projection(x, s);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(r, nil:bat[:oid], nil:int, nil:int, true, true, false);
@@ -991,20 +991,20 @@ io.print("nothing");
x := algebra.select(r, nil:bat[:oid], 7, 3, true, true, true);
z := algebra.projection(x, r);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(r, nil:bat[:oid], 7, 3, true, false, true);
z := algebra.projection(x, r);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(r, nil:bat[:oid], 7, 3, false, true, true);
z := algebra.projection(x, r);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
x := algebra.select(r, nil:bat[:oid], 7, 3, false, false, true);
z := algebra.projection(x, r);
z := algebra.sort(z, false, true);
-io.print(z); # nothing
-io.print("nothing");
+io.print(z); # 0,1,2,3,4,5,6,7,8,9
+io.print("0,1,2,3,4,5,6,7,8,9");
diff --git a/monetdb5/modules/kernel/Tests/select.stable.out
b/monetdb5/modules/kernel/Tests/select.stable.out
--- a/monetdb5/modules/kernel/Tests/select.stable.out
+++ b/monetdb5/modules/kernel/Tests/select.stable.out
@@ -451,22 +451,62 @@ Ready.
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void oid # type
@@ -907,22 +947,62 @@ Ready.
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
+[ 8@0, 8 ]
+[ 9@0, 9 ]
+[ "0,1,2,3,4,5,6,7,8,9" ]
#--------------------------#
# h t # name
# void int # type
@@ -1348,22 +1428,62 @@ Ready.
# h t # name
# void int # type
#--------------------------#
-[ "nothing" ]
+[ 0@0, 0 ]
+[ 1@0, 1 ]
+[ 2@0, 2 ]
+[ 3@0, 3 ]
+[ 4@0, 4 ]
+[ 5@0, 5 ]
+[ 6@0, 6 ]
+[ 7@0, 7 ]
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list