]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a faulty assert in the schema parsing logic.
authordrh <drh@noemail.net>
Sun, 19 Apr 2015 20:39:17 +0000 (20:39 +0000)
committerdrh <drh@noemail.net>
Sun, 19 Apr 2015 20:39:17 +0000 (20:39 +0000)
FossilOrigin-Name: b1ed949584a2526c04952b98c3aa283427f45e10

manifest
manifest.uuid
src/build.c
test/misc1.test

index 05699e70afc162101b133067387eabd1924ae247..45fb2ca55d33c374a644e80de831112b5b471edd 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\spotential\sNULL\spointer\sdeference\son\sa\scorrupt\sdatabase\sschema.
-D 2015-04-19T19:21:19.025
+C Fix\sa\sfaulty\sassert\sin\sthe\sschema\sparsing\slogic.
+D 2015-04-19T20:39:17.335
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in faaf75b89840659d74501bea269c7e33414761c1
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -176,7 +176,7 @@ F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
 F src/btree.c 127aceb71ba93f59bc9c6ba810e992a04299e98a
 F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1
 F src/btreeInt.h 973a22a6fd61350b454ad614832b1f0a5e25a1e4
-F src/build.c 2d43ee768a3678eaeed203ba5b55490b970f0a5e
+F src/build.c bc3a513a57b0962aa98b38ab9c850f3987457885
 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
 F src/complete.c a5cf5b4b56390cfb7b8636e8f7ddef90258dd575
 F src/ctime.c 98f89724adc891a1a4c655bee04e33e716e05887
@@ -743,7 +743,7 @@ F test/minmax.test 42fbad0e81afaa6e0de41c960329f2b2c3526efd
 F test/minmax2.test b44bae787fc7b227597b01b0ca5575c7cb54d3bc
 F test/minmax3.test cc1e8b010136db0d01a6f2a29ba5a9f321034354
 F test/minmax4.test 936941484ebdceb8adec7c86b6cd9b6e5e897c1f
-F test/misc1.test 623405f6da1ea0b78b68c0549ee6c2cc027668f2
+F test/misc1.test e908edf5c6e02dcc7453c1519e59625c67cc099e
 F test/misc2.test 00d7de54eda90e237fc9a38b9e5ccc769ebf6d4d
 F test/misc3.test cf3dda47d5dda3e53fc5804a100d3c82be736c9d
 F test/misc4.test 9c078510fbfff05a9869a0b6d8b86a623ad2c4f6
@@ -1251,7 +1251,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 4ac81fac6c6302c042be3df493a41630b733fff0
-R 217c2ee5ae382a4066646fde6de10d74
+P dc61b292d8eaf422ca8a2b18f1caccef1a5389fd
+R cfb6006d4eb96e8b001f7f44f28a3f5a
 U drh
-Z 68ce861ea89d3d58ce69aec04612a1ea
+Z 30562fcecce8e59f5b0c8b52be03b8fe
index 18c9f61d965e5218704eafec37ec2c81eae147f8..496f912ba173493b4eada13de02293bc11a8ffe5 100644 (file)
@@ -1 +1 @@
-dc61b292d8eaf422ca8a2b18f1caccef1a5389fd
\ No newline at end of file
+b1ed949584a2526c04952b98c3aa283427f45e10
\ No newline at end of file
index 9e4adcb21b595c8f4fc22b3048c731eef70a85ca..52f4e27e321074576ad1585c5269258372458848 100644 (file)
@@ -927,7 +927,7 @@ void sqlite3StartTable(
       if( !noErr ){
         sqlite3ErrorMsg(pParse, "table %T already exists", pName);
       }else{
-        assert( !db->init.busy );
+        assert( !db->init.busy || CORRUPT_DB );
         sqlite3CodeVerifySchema(pParse, iDb);
       }
       goto begin_table_error;
index 9408f2a8a2df7e7977448c9577929ac69da0a000..0dc4d81347398b311a300ae8a2216c511944fb13 100644 (file)
@@ -646,9 +646,9 @@ do_execsql_test misc1-22.1 {
 
 # 2015-04-19: NULL pointer dereference on a corrupt schema
 #
+db close
+sqlite3 db :memory:
 do_execsql_test misc1-23.1 {
-  DROP TABLE IF EXISTS t1;
-  DROP TABLE IF EXISTS t2;
   CREATE TABLE t1(x);
   PRAGMA writable_schema=ON;
   UPDATE sqlite_master SET sql='CREATE table t(d CHECK(T(#0)';
@@ -658,4 +658,19 @@ do_execsql_test misc1-23.1 {
   DROP TABLE IF EXISTS t3;
 } {}
 
+# 2015-04-19:  Faulty assert() statement
+#
+db close
+database_may_be_corrupt
+sqlite3 db :memory:
+do_catchsql_test misc1-23.2 {
+  CREATE TABLE t1(x UNIQUE);
+  PRAGMA writable_schema=ON;
+  UPDATE sqlite_master SET sql='CREATE TABLE IF not EXISTS t(c)';
+  BEGIN;
+  CREATE TABLE t2(x);
+  ROLLBACK;
+  DROP TABLE F;
+} {1 {no such table: F}}
+
 finish_test