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 /src | |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/prepare.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 |