mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Do all WHERE clauses tests, even if an index is used for lookup so that
we know the test cannot be FALSE. The test might end up being NULL in which case it would need to be treated as false. Ticket #461. (CVS 1103) FossilOrigin-Name: 5aea81488b2d3bcdc009ccf0f0ffcda046e38d79
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the CREATE INDEX statement.
|
||||
#
|
||||
# $Id: index.test,v 1.23 2003/06/15 23:42:25 drh Exp $
|
||||
# $Id: index.test,v 1.24 2003/09/27 00:41:28 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -473,22 +473,22 @@ do_test index-14.8 {
|
||||
execsql {
|
||||
SELECT c FROM t6 WHERE a<'abc';
|
||||
}
|
||||
} {3 5 2 1}
|
||||
} {5 2 1}
|
||||
do_test index-14.9 {
|
||||
execsql {
|
||||
SELECT c FROM t6 WHERE a<='abc';
|
||||
}
|
||||
} {3 5 2 1 4}
|
||||
} {5 2 1 4}
|
||||
do_test index-14.10 {
|
||||
execsql {
|
||||
SELECT c FROM t6 WHERE a<='';
|
||||
}
|
||||
} {3 5 2 1}
|
||||
} {5 2 1}
|
||||
do_test index-14.11 {
|
||||
execsql {
|
||||
SELECT c FROM t6 WHERE a<'';
|
||||
}
|
||||
} {3 5}
|
||||
} {5}
|
||||
integrity_check index-14.12
|
||||
|
||||
do_test index-15.1 {
|
||||
|
@ -173,6 +173,64 @@ do_test null-7.2 {
|
||||
}
|
||||
} {1 2 3}
|
||||
|
||||
# Ticket #461 - Make sure nulls are handled correctly when doing a
|
||||
# lookup using an index.
|
||||
#
|
||||
do_test null-8.1 {
|
||||
execsql {
|
||||
CREATE TABLE t4(x,y);
|
||||
INSERT INTO t4 VALUES(1,11);
|
||||
INSERT INTO t4 VALUES(2,NULL);
|
||||
SELECT x FROM t4 WHERE y=NULL;
|
||||
}
|
||||
} {}
|
||||
do_test null-8.2 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y IN (33,NULL);
|
||||
}
|
||||
} {}
|
||||
do_test null-8.3 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y<33 ORDER BY x;
|
||||
}
|
||||
} {1}
|
||||
do_test null-8.4 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y>6 ORDER BY x;
|
||||
}
|
||||
} {1}
|
||||
do_test null-8.5 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y!=33 ORDER BY x;
|
||||
}
|
||||
} {1}
|
||||
do_test null-8.11 {
|
||||
execsql {
|
||||
CREATE INDEX t4i1 ON t4(y);
|
||||
SELECT x FROM t4 WHERE y=NULL;
|
||||
}
|
||||
} {}
|
||||
do_test null-8.12 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y IN (33,NULL);
|
||||
}
|
||||
} {}
|
||||
do_test null-8.13 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y<33 ORDER BY x;
|
||||
}
|
||||
} {1}
|
||||
do_test null-8.14 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y>6 ORDER BY x;
|
||||
}
|
||||
} {1}
|
||||
do_test null-8.15 {
|
||||
execsql {
|
||||
SELECT x FROM t4 WHERE y!=33 ORDER BY x;
|
||||
}
|
||||
} {1}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user