-C More\sdefenses\sagainst\svirtual\stable\sbeing\sdeleted\sout\sfrom\sunder\sa\srunning\nstatement.
-D 2015-03-24T14:05:50.045
+C Add\stests\sto\scheck\sthat\sattempting\sto\sDROP\sa\svirtual\stable\swhile\sit\sis\suse\sdoes\snot\scause\sproblems.
+D 2015-03-24T14:57:21.959
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/veryquick.test 57ab846bacf7b90cf4e9a672721ea5c5b669b661
F test/view.test f311691d696a5cc27e3c1b875cec1b0866b4ccd9
-F test/vtab1.test 1cef14310144718812351a61c5cfb4ba8494a171
+F test/vtab1.test c9dc2a73e93331d70b37ce4b246ef6dc18412fef
F test/vtab2.test 3644649aa8d1daac57fd541f6a5f914cac59203e
F test/vtab3.test b45f47d20f225ccc9c28dc915d92740c2dee311e
F test/vtab4.test 942f8b8280b3ea8a41dae20e7822d065ca1cb275
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P fba674c083286dabb37fed9357b67593b56ed3a5
-R 6651e18da796c17c1ca503ba6b1b311c
-U drh
-Z 91702967a80a94e761fcc487487cb422
+P 116c99823022c017946b6088878a2d46759deb6e
+R 791eb1db9d6d4dcf9879622b22bdbc4e
+U dan
+Z 5721bb8cdc400d9869a3df977b6ecfb6
} {SQLITE_OK}
}
+
+#-------------------------------------------------------------------------
+# The following tests verify that a DROP TABLE command on a virtual
+# table does not cause other operations to crash.
+#
+# 23.1: Dropping a vtab while a SELECT is running on it.
+#
+# 23.2: Dropping a vtab while a SELECT that will, but has not yet,
+# open a cursor on the vtab, is running. In this case the
+# DROP TABLE succeeds and the SELECT hits an error.
+#
+# 23.3: Dropping a vtab from within a user-defined-function callback
+# in the middle of an "INSERT INTO vtab SELECT ..." statement.
+#
+reset_db
+load_static_extension db wholenumber
+load_static_extension db eval
+register_echo_module db
+
+do_test 23.1 {
+ execsql { CREATE VIRTUAL TABLE t1 USING wholenumber }
+ set res ""
+ db eval { SELECT value FROM t1 WHERE value<10 } {
+ if {$value == 5} {
+ set res [catchsql { DROP TABLE t1 }]
+ }
+ }
+ set res
+} {1 {database table is locked}}
+
+do_test 23.2 {
+ execsql {
+ CREATE TABLE t2(value);
+ INSERT INTO t2 VALUES(1), (2), (3);
+ }
+
+ set res2 [list [catch {
+ db eval {
+ SELECT value FROM t2 UNION ALL
+ SELECT value FROM t1 WHERE value<10
+ } {
+ if {$value == 2} { set res1 [catchsql { DROP TABLE t1 }] }
+ }
+ } msg] $msg]
+ list $res1 $res2
+} {{0 {}} {1 {database table is locked}}}
+
+do_test 23.3.1 {
+ execsql { CREATE VIRTUAL TABLE t1e USING echo(t2) }
+ execsql { INSERT INTO t1e SELECT 4 }
+ catchsql { INSERT INTO t1e SELECT eval('DROP TABLE t1e') }
+} {1 {database table is locked}}
+do_execsql_test 23.3.2 { SELECT * FROM t1e } {1 2 3 4}
+
finish_test