diff options
Diffstat (limited to 'third_party/sqlite/test/select1.test')
-rw-r--r-- | third_party/sqlite/test/select1.test | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/third_party/sqlite/test/select1.test b/third_party/sqlite/test/select1.test index 59c3b58..73b0e40 100644 --- a/third_party/sqlite/test/select1.test +++ b/third_party/sqlite/test/select1.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the SELECT statement. # -# $Id: select1.test,v 1.65 2008/08/04 03:51:24 danielk1977 Exp $ +# $Id: select1.test,v 1.70 2009/05/28 01:00:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -306,7 +306,7 @@ do_test select1-4.3 { do_test select1-4.4 { set v [catch {execsql {SELECT f1 FROM test1 ORDER BY min(f1)}} msg] lappend v $msg -} {1 {misuse of aggregate: min(f1)}} +} {1 {misuse of aggregate: min()}} # The restriction not allowing constants in the ORDER BY clause # has been removed. See ticket #1768 @@ -1022,9 +1022,12 @@ ifcapable subquery { } {0} } +foreach tab [db eval {SELECT name FROM sqlite_master WHERE type = 'table'}] { + db eval "DROP TABLE $tab" +} db close -file delete -force test.db sqlite3 db test.db + do_test select1-14.1 { execsql { SELECT * FROM sqlite_master WHERE rowid>10; @@ -1041,4 +1044,27 @@ do_test select1-14.2 { } } {0} +if {[db one {PRAGMA locking_mode}]=="normal"} { + # Check that ticket #3771 has been fixed. This test does not + # work with locking_mode=EXCLUSIVE so disable in that case. + # + do_test select1-15.1 { + execsql { + CREATE TABLE t1(a); + CREATE INDEX i1 ON t1(a); + INSERT INTO t1 VALUES(1); + INSERT INTO t1 VALUES(2); + INSERT INTO t1 VALUES(3); + } + } {} + do_test select1-15.2 { + sqlite3 db2 test.db + execsql { DROP INDEX i1 } db2 + db2 close + } {} + do_test select1-15.3 { + execsql { SELECT 2 IN (SELECT a FROM t1) } + } {1} +} + finish_test |