diff options
author | drh <drh@noemail.net> | 2015-04-16 00:26:03 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-04-16 00:26:03 +0000 |
commit | 22ecef5c20e007ae5121d9febb3bb3d7f56097b0 (patch) | |
tree | 1915625c3f85686e9b146e0b863627531f45888d | |
parent | 4b608038b0d3b00c42c84faa1414ae1d037027b5 (diff) | |
download | sqlite-22ecef5c20e007ae5121d9febb3bb3d7f56097b0.tar.gz sqlite-22ecef5c20e007ae5121d9febb3bb3d7f56097b0.zip |
When parsing the schema, ignore any SQL that does not begin with "CREATE".
FossilOrigin-Name: d3c00d61581c8ba6dce5618391432d3af8d324d4
-rw-r--r-- | manifest | 18 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/prepare.c | 6 | ||||
-rw-r--r-- | test/analyze.test | 2 | ||||
-rw-r--r-- | test/index3.test | 2 | ||||
-rw-r--r-- | test/trigger7.test | 2 |
6 files changed, 16 insertions, 16 deletions
@@ -1,5 +1,5 @@ -C Fix\sa\spotential\sone-byte\sbuffer\soverread\sin\sthe\scommand-line\sshell. -D 2015-04-15T19:25:25.409 +C When\sparsing\sthe\sschema,\signore\sany\sSQL\sthat\sdoes\snot\sbegin\swith\s"CREATE". +D 2015-04-16T00:26:03.247 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5f78b1ab81b64e7c57a75d170832443e66c0880a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -225,7 +225,7 @@ F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache1.c 69d137620a305f814398bd29a0c998038c0695e9 F src/pragma.c 3965ae4e82bed39fb97ce04c5fe18c9bc3ee6a88 F src/pragma.h 09c89bca58e9a44de2116cc8272b8d454657129f -F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 +F src/prepare.c 1fffbdcd6f8a0173a8f70d71f22528f4c0e1e3d3 F src/printf.c 08fa675c200aac29e561c6153f91f909ed17612f F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c 66cfe49a9c3b449ef13b89a8c47036a4ed167eab @@ -320,7 +320,7 @@ F test/alter3.test 49c9d9fba2b8fcdce2dedeca97bbf1f369cc548d F test/alter4.test c461150723ac957f3b2214aa0b11552cd72023ec F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f -F test/analyze.test 1772936d66471c65221e437b6d1999c3a03166c4 +F test/analyze.test 3eb35a4af972f98422e5dc0586501b17d103d321 F test/analyze3.test 75b9e42ea1e4edc919250450dc5762186965d4e6 F test/analyze4.test eff2df19b8dd84529966420f29ea52edc6b56213 F test/analyze5.test 765c4e284aa69ca172772aa940946f55629bc8c4 @@ -655,7 +655,7 @@ F test/incrvacuum3.test 75256fb1377e7c39ef2de62bfc42bbff67be295a F test/incrvacuum_ioerr.test 6ae2f783424e47a0033304808fe27789cf93e635 F test/index.test 4d990005a67a36984e4f1a5f1bdccea8d08da4ee F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6 -F test/index3.test 55a90cff99834305e8141df7afaef39674b57062 +F test/index3.test b6ec456cf3b81d9a32123fe7e449bde434db338b F test/index4.test ab92e736d5946840236cd61ac3191f91a7856bf6 F test/index5.test 25b0b451aceed4ac5f7d49f856f6de7257470b3e F test/index6.test 3ae54e53c53f2adcacda269237d8e52bdb05a481 @@ -1082,7 +1082,7 @@ F test/trigger3.test aa640bb2bbb03edd5ff69c055117ea088f121945 F test/trigger4.test 74700b76ebf3947b2f7a92405141eb2cf2a5d359 F test/trigger5.test 619391a3e9fc194081d22cefd830d811e7badf83 F test/trigger6.test 0e411654f122552da6590f0b4e6f781048a4a9b9 -F test/trigger7.test b39e6dee1debe0ff9c2ef66326668f149f07c9c4 +F test/trigger7.test 200dd51e728c9cdc20c72d99d9e9d45c667248f8 F test/trigger8.test 30cb0530bd7c4728055420e3f739aa00412eafa4 F test/trigger9.test 2226ec795a33b0460ab5cf8891e9054cc7edef41 F test/triggerA.test fe5597f47ee21bacb4936dc827994ed94161e332 @@ -1250,7 +1250,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 f71053cf658b3260a32ac06f8ba5c2cde0ea54dd -R eab6e1273b6697560bfb82b228385932 +P e018f4bf1f27f7838342940ad89a12d7f1536e8e +R 9772cd879deb52a3e48d7b6cb0b29092 U drh -Z 6d428eedf5ae6fc2d3dc612cb5905085 +Z 089490261a72224f9edd48b4acf9b866 diff --git a/manifest.uuid b/manifest.uuid index 5482423ef..e0b027b22 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e018f4bf1f27f7838342940ad89a12d7f1536e8e
\ No newline at end of file +d3c00d61581c8ba6dce5618391432d3af8d324d4
\ No newline at end of file diff --git a/src/prepare.c b/src/prepare.c index 97be900d6..a55a0fee4 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -67,7 +67,7 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){ if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ if( argv[1]==0 ){ corruptSchema(pData, argv[0], 0); - }else if( argv[2] && argv[2][0] ){ + }else if( sqlite3_strnicmp(argv[2],"create ",7)==0 ){ /* Call the parser to process a CREATE TABLE, INDEX or VIEW. ** But because db->init.busy is set to 1, no VDBE code is generated ** or executed. All the parser does is build the internal data @@ -98,8 +98,8 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){ } } sqlite3_finalize(pStmt); - }else if( argv[0]==0 ){ - corruptSchema(pData, 0, 0); + }else if( argv[0]==0 || (argv[2]!=0 && argv[2][0]!=0) ){ + corruptSchema(pData, argv[0], 0); }else{ /* If the SQL column is blank it means this is an index that ** was created to be the PRIMARY KEY or to fulfill a UNIQUE diff --git a/test/analyze.test b/test/analyze.test index c44508426..af277cc83 100644 --- a/test/analyze.test +++ b/test/analyze.test @@ -359,6 +359,6 @@ do_test analyze-99.1 { catchsql { ANALYZE } -} {1 {malformed database schema (sqlite_stat1) - near "nonsense": syntax error}} +} {1 {malformed database schema (sqlite_stat1)}} finish_test diff --git a/test/index3.test b/test/index3.test index a9f9b7ae6..0cdc6e088 100644 --- a/test/index3.test +++ b/test/index3.test @@ -51,6 +51,6 @@ do_test index3-99.1 { db close catch { sqlite3 db test.db } catchsql { DROP INDEX i1 } -} {1 {malformed database schema (t1) - near "nonsense": syntax error}} +} {1 {malformed database schema (t1)}} finish_test diff --git a/test/trigger7.test b/test/trigger7.test index 8fde2004f..221962406 100644 --- a/test/trigger7.test +++ b/test/trigger7.test @@ -114,6 +114,6 @@ do_test trigger7-99.1 { db close catch { sqlite3 db test.db } catchsql { DROP TRIGGER t2r5 } -} {1 {malformed database schema (t2r12) - near "nonsense": syntax error}} +} {1 {malformed database schema (t2r12)}} finish_test |