diff options
Diffstat (limited to 'third_party/sqlite/test/shared2.test')
-rw-r--r-- | third_party/sqlite/test/shared2.test | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/third_party/sqlite/test/shared2.test b/third_party/sqlite/test/shared2.test index 5f18f8b..37f9516 100644 --- a/third_party/sqlite/test/shared2.test +++ b/third_party/sqlite/test/shared2.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# $Id: shared2.test,v 1.5 2007/08/23 02:47:54 drh Exp $ +# $Id: shared2.test,v 1.8 2009/06/05 17:09:12 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -127,5 +127,44 @@ do_test shared2-3.2 { sqlite3_enable_shared_cache 1 } {1} +file delete -force test.db + +sqlite3 db test.db +do_test shared2-4.1 { + execsql { + CREATE TABLE t0(a, b); + CREATE TABLE t1(a, b DEFAULT 'hello world'); + } +} {} +db close + +sqlite3 db test.db +sqlite3 db2 test.db + +do_test shared2-4.2 { + execsql { SELECT a, b FROM t0 } db + execsql { INSERT INTO t1(a) VALUES(1) } db2 +} {} + +do_test shared2-4.3 { + db2 close + db close +} {} + +# At one point, this was causing a crash. +# +do_test shared2-5.1 { + sqlite3 db test.db + sqlite3 db2 test.db + execsql { CREATE TABLE t2(a, b, c) } + + # The following statement would crash when attempting to sqlite3_free() + # a pointer allocated from a lookaside buffer. + execsql { CREATE INDEX i1 ON t2(a) } db2 +} {} + +db close +db2 close + sqlite3_enable_shared_cache $::enable_shared_cache finish_test |