mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Increased test coverage in where.c. (CVS 6146)
FossilOrigin-Name: 1e5725c5179660277c2e8c321877d7ee3ca21808
This commit is contained in:
@ -11,13 +11,12 @@
|
||||
#
|
||||
# This test script checks malloc failures in WHERE clause analysis.
|
||||
#
|
||||
# $Id: mallocK.test,v 1.2 2009/01/08 03:11:19 drh Exp $
|
||||
# $Id: mallocK.test,v 1.3 2009/01/08 21:00:03 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
source $testdir/malloc_common.tcl
|
||||
|
||||
|
||||
set sql {SELECT * FROM t1, t2 WHERE (a=1 OR a=2)}
|
||||
for {set x 1} {$x<5} {incr x} {
|
||||
append sql " AND b=y"
|
||||
@ -27,7 +26,7 @@ for {set x 1} {$x<5} {incr x} {
|
||||
}
|
||||
}
|
||||
|
||||
set sql {SELECT * FROM t1 WHERE a GLOB 'xyz*'}
|
||||
set sql {SELECT * FROM t1 WHERE a GLOB 'xyz*' AND (a=1 OR a=2)}
|
||||
for {set x 1} {$x<5} {incr x} {
|
||||
append sql " AND b!=$x"
|
||||
do_malloc_test mallocK-2.$x -sqlbody $sql -sqlprep {
|
||||
@ -37,17 +36,29 @@ for {set x 1} {$x<5} {incr x} {
|
||||
|
||||
set sql {SELECT * FROM t1 WHERE a BETWEEN 5 AND 10}
|
||||
for {set x 1} {$x<5} {incr x} {
|
||||
append sql " AND b!=$x"
|
||||
append sql " AND b=$x"
|
||||
do_malloc_test mallocK-3.$x -sqlbody $sql -sqlprep {
|
||||
CREATE TABLE t1(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
set sql {SELECT * FROM t1 WHERE b=0}
|
||||
for {set x 1} {$x<5} {incr x} {
|
||||
set term "(b=$x"
|
||||
for {set y 0} {$y<$x} {incr y} {
|
||||
append term " AND a!=$y"
|
||||
}
|
||||
append sql " OR $term)"
|
||||
do_malloc_test mallocK-4.$x -sqlbody $sql -sqlprep {
|
||||
CREATE TABLE t1(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
ifcapable vtab {
|
||||
set sql {SELECT * FROM t2 WHERE a MATCH 'xyz'}
|
||||
for {set x 1} {$x<5} {incr x} {
|
||||
append sql " AND b!=$x"
|
||||
do_malloc_test mallocK-4.$x -sqlbody $sql -tclprep {
|
||||
do_malloc_test mallocK-5.$x -sqlbody $sql -tclprep {
|
||||
register_echo_module [sqlite3_connection_pointer db]
|
||||
db eval {
|
||||
CREATE TABLE t1(a,b);
|
||||
|
Reference in New Issue
Block a user