diff options
author | drh <drh@noemail.net> | 2019-09-26 20:05:16 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-09-26 20:05:16 +0000 |
commit | 91f34eab2d08ef03e4454664458960f746ba580e (patch) | |
tree | 23134dbe650b1e664ade3a37a75aaff6ae28b3b6 /src | |
parent | 9d30c8ff8fe09e4564fa8b7dd1c7fc9badd5cd2c (diff) | |
download | sqlite-91f34eab2d08ef03e4454664458960f746ba580e.tar.gz sqlite-91f34eab2d08ef03e4454664458960f746ba580e.zip |
Allow DROP TABLE to work on tables name "sqlite_parameters" just as it
does with tables named "sqlite_stat%". Fix for the ".parameter clear"
command in the shell.
FossilOrigin-Name: e768179baacb2423205a774cc8149fe58ed86a9320102aff4844b1d8933aa1db
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 3 | ||||
-rw-r--r-- | src/shell.c.in | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/build.c b/src/build.c index 106b995d3..a3d1abf04 100644 --- a/src/build.c +++ b/src/build.c @@ -2816,7 +2816,8 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){ } #endif if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 - && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ + && sqlite3StrNICmp(pTab->zName+7, "stat", 4)!=0 + && sqlite3StrNICmp(pTab->zName+7, "parameters", 10)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); goto exit_drop_table; } diff --git a/src/shell.c.in b/src/shell.c.in index bde360b0e..549216e32 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -8148,12 +8148,8 @@ static int do_meta_command(char *zLine, ShellState *p){ ** Clear all bind parameters by dropping the TEMP table that holds them. */ if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ - int wrSchema = 0; - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", 0, 0, 0); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); }else /* .parameter list |