0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-12-01 17:23:42 +01:00

Additional test cases for comparisons against NULL in the WHERE clause

and elsewhere in a SELECT. (CVS 4051)

FossilOrigin-Name: 72612a0373c7abf8aadfdeb46358c0b0ae7b07a0
This commit is contained in:
drh 2007-06-08 08:43:10 +00:00
parent f07b484449
commit b70429577f
3 changed files with 80 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Make\ssure\srowid\scomparisons\sagainst\sNULL\swork\scorrectly.\s\sTicket\s#2404.\s(CVS\s4050)
D 2007-06-08T08:39:02
C Additional\stest\scases\sfor\scomparisons\sagainst\sNULL\sin\sthe\sWHERE\sclause\nand\selsewhere\sin\sa\sSELECT.\s(CVS\s4051)
D 2007-06-08T08:43:10
F Makefile.in a42354804b50c2708ce72cf79e4daa30f50191b5
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -424,7 +424,7 @@ F test/where.test 5c342d6ad0d777275d4740ea5cbeaf5173b6eda4
F test/where2.test 3249d426b3fc7a106713d784e1628307fc308d2e
F test/where3.test 0a30fe9808b0fa01c46d0fcf4fac0bf6cf75bb30
F test/where4.test f80207a4ea6504f3d0962f3ecebc7db274ea50c0
F test/where5.test 402d3bbe94edf89d41bc556dc8e621df9768b418
F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
F test/zeroblob.test c5096545085330b7886d2f977272a73d9fa7737e
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
@ -501,7 +501,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 46fdd195483787eef209a9b8ad108eba147be6fa
R e8f6143bfd4596c3133479efdd40f198
P 11ee8ea43f20f6146f4e4fcd9299468b3a99f998
R 05a9a5f63d57dfcd13c111df92ba4c0c
U drh
Z a9444c898b9b5e55afca76332b67eee3
Z 2f14a325dddcad80036ac767af210cc8

View File

@ -1 +1 @@
11ee8ea43f20f6146f4e4fcd9299468b3a99f998
72612a0373c7abf8aadfdeb46358c0b0ae7b07a0

View File

@ -12,7 +12,7 @@
# focus of this file is testing NULL comparisons in the WHERE clause.
# See ticket #2404.
#
# $Id: where5.test,v 1.1 2007/06/08 08:39:02 drh Exp $
# $Id: where5.test,v 1.2 2007/06/08 08:43:10 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -89,6 +89,17 @@ do_test where5-1.11 {
SELECT * FROM t1 WHERE x!=NULL
}
} {}
do_test where5-1.12 {
execsql {
SELECT * FROM t1 WHERE x IS NULL
}
} {}
do_test where5-1.13 {
execsql {
SELECT * FROM t1 WHERE x IS NOT NULL
}
} {-1 0 1}
do_test where5-2.0 {
execsql {
@ -150,6 +161,17 @@ do_test where5-2.11 {
SELECT * FROM t2 WHERE x!=NULL
}
} {}
do_test where5-2.12 {
execsql {
SELECT * FROM t2 WHERE x IS NULL
}
} {}
do_test where5-2.13 {
execsql {
SELECT * FROM t2 WHERE x IS NOT NULL
}
} {-1 0 1}
do_test where5-3.0 {
execsql {
@ -211,6 +233,56 @@ do_test where5-3.11 {
SELECT * FROM t3 WHERE x!=NULL
}
} {}
do_test where5-3.12 {
execsql {
SELECT * FROM t3 WHERE x IS NULL
}
} {}
do_test where5-3.13 {
execsql {
SELECT * FROM t3 WHERE x IS NOT NULL
}
} {-1 0 1}
do_test where5-4.0 {
execsql {
SELECT x<NULL FROM t3
}
} {{} {} {}}
do_test where5-4.1 {
execsql {
SELECT x<=NULL FROM t3
}
} {{} {} {}}
do_test where5-4.2 {
execsql {
SELECT x==NULL FROM t3
}
} {{} {} {}}
do_test where5-4.3 {
execsql {
SELECT x>NULL FROM t3
}
} {{} {} {}}
do_test where5-4.4 {
execsql {
SELECT x>=NULL FROM t3
}
} {{} {} {}}
do_test where5-4.5 {
execsql {
SELECT x!=NULL FROM t3
}
} {{} {} {}}
do_test where5-4.6 {
execsql {
SELECT x IS NULL FROM t3
}
} {0 0 0}
do_test where5-4.7 {
execsql {
SELECT x IS NOT NULL FROM t3
}
} {1 1 1}
finish_test