1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

NULL values are distinct. A comparison involving a NULL is always false.

Operations on a NULL value yield a NULL result.  This change makes SQLite
operate more like the SQL spec, but it may break existing applications that
assumed the old behavior.  All the old tests pass but we still need to add
new tests to better verify the new behavior.  Fix for ticket #44. (CVS 589)

FossilOrigin-Name: 9051173742f1b0e15a809d12a0c9c98fd2c4614d
This commit is contained in:
drh
2002-05-26 20:54:33 +00:00
parent 195e6967fb
commit f5905aa7be
15 changed files with 485 additions and 238 deletions

View File

@ -12,7 +12,7 @@
# focus of this file is testing SELECT statements that are part of
# expressions.
#
# $Id: subselect.test,v 1.4 2001/09/16 00:13:28 drh Exp $
# $Id: subselect.test,v 1.5 2002/05/26 20:54:35 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -55,9 +55,8 @@ do_test subselect-1.3c {
# NULL as the result. Check it out.
#
do_test subselect-1.4 {
execsql {INSERT INTO t1 VALUES(NULL,8)}
execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=5)}
} {8}
execsql {SELECT b from t1 where a = coalesce((SELECT a FROM t1 WHERE b=5),1)}
} {2}
# Try multiple subselects within a single expression.
#