Handle "IS NULL" constraints on virtual table scans. IS NULL constraints are not passed to the virtual table layer. Ticket #2759. (CVS 4523)

FossilOrigin-Name: 7027368c15b3270a139bea5612d7c03c2288dcc4
This commit is contained in:
danielk1977
2007-11-05 05:12:53 +00:00
parent 3b1a9881e7
commit 6d64307b03
4 changed files with 43 additions and 11 deletions
+31 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is creating and dropping virtual tables.
#
# $Id: vtab1.test,v 1.47 2007/10/09 08:29:33 danielk1977 Exp $
# $Id: vtab1.test,v 1.48 2007/11/05 05:12:53 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -946,5 +946,35 @@ do_test vtab1.12-6 {
execsql { SELECT * FROM c }
} {3 G H}
# At one point (ticket #2759), a WHERE clause of the form "<column> IS NULL"
# on a virtual table was causing an assert() to fail in the compiler.
#
# "IS NULL" clauses should not be passed through to the virtual table
# implementation. They are handled by SQLite after the vtab returns it's
# data.
#
do_test vtab1.13-1 {
execsql {
SELECT * FROM echo_c WHERE a IS NULL
}
} {}
do_test vtab1.13-2 {
execsql {
INSERT INTO c VALUES(NULL, 15, 16);
SELECT * FROM echo_c WHERE a IS NULL
}
} {{} 15 16}
do_test vtab1.13-3 {
execsql {
INSERT INTO c VALUES(15, NULL, 16);
SELECT * FROM echo_c WHERE b IS NULL
}
} {15 {} 16}
do_test vtab1.13-3 {
execsql {
SELECT * FROM echo_c WHERE b IS NULL AND a = 15;
}
} {15 {} 16}
unset -nocomplain echo_module_begin_fail
finish_test