diff options
author | Hans-Christoph Steiner <hans@eds.org> | 2014-10-16 22:51:43 -0400 |
---|---|---|
committer | Hans-Christoph Steiner <hans@eds.org> | 2014-10-16 22:51:43 -0400 |
commit | 9f67c0520ea0d5f11a190197cdf746c512db4ce4 (patch) | |
tree | c88a33f01f20a3d13a09594f114fffacebd0d1a4 /test/vtab_shared.test | |
parent | ee20336e9c78d2e3782c8d096b9ab4f6ca8ce95f (diff) | |
parent | 569c6676a6ddb0ff73821d7693b5e18ddef809b9 (diff) |
Merge tag 'upstream/3.2.0'
Upstream version 3.2.0
# gpg: Signature made Thu 16 Oct 2014 10:51:39 PM EDT using RSA key ID 374BBE81
# gpg: Good signature from "Hans-Christoph Steiner <hans@guardianproject.info>"
# gpg: aka "Hans-Christoph Steiner <hans@eds.org>"
# gpg: aka "Hans-Christoph Steiner <hans@at.or.at>"
# gpg: aka "[jpeg image of size 5408]"
Diffstat (limited to 'test/vtab_shared.test')
-rw-r--r-- | test/vtab_shared.test | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/test/vtab_shared.test b/test/vtab_shared.test index 6a76e27..3473992 100644 --- a/test/vtab_shared.test +++ b/test/vtab_shared.test @@ -15,6 +15,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl +set testprefix vtab_shared ifcapable !vtab||!shared_cache { finish_test @@ -116,7 +117,6 @@ do_test vtab_shared-1.10 { } {1 {database table is locked: sqlite_master}} do_test vtab_shared-1.11 { -breakpoint execsql { CREATE VIRTUAL TABLE t2 USING echo(t0); CREATE VIRTUAL TABLE t3 USING echo(t0); @@ -229,5 +229,51 @@ do_test vtab_shared_1.15.3 { db close db2 close + +#--------------------------------------------------------------- +# Test calling sqlite3_close() with vtabs on the disconnect list. +# +ifcapable rtree { + reset_db + do_test 2.1.1 { + sqlite3 db test.db + sqlite3 db2 test.db + + # Create a virtual table using [db]. + execsql { + CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2); + INSERT INTO rt VALUES(1, 2 ,3); + SELECT * FROM rt; + } + + # Drop the virtual table using [db2]. The sqlite3_vtab object belonging + # to [db] is moved to the sqlite3.pDisconnect list. + execsql { DROP TABLE rt } db2 + + # Immediately close [db]. At one point this would fail due to the + # unfinalized statements held by the un-xDisconnect()ed sqlite3_vtab. + db close + } {} + db2 close +} + +ifcapable fts3 { + # Same test as above, except using fts3 instead of rtree. + reset_db + do_test 2.2.1 { + sqlite3 db test.db + sqlite3 db2 test.db + execsql { + CREATE VIRTUAL TABLE ft USING fts3; + INSERT INTO ft VALUES('hello world'); + SELECT * FROM ft; + } + execsql { DROP TABLE ft } db2 + db close + } {} + db2 close +} + sqlite3_enable_shared_cache 0 finish_test + |