aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2021-10-08 16:39:33 +0000
committerdrh <>2021-10-08 16:39:33 +0000
commit635e6a92a0a2ef0f97b6d1ab85d5eba1625d3cad (patch)
tree19a342697a72685a8d07cf3e475df598a5b9317f /src
parent635480ef475da35161b334c4051deef7c37fb206 (diff)
downloadsqlite-635e6a92a0a2ef0f97b6d1ab85d5eba1625d3cad.tar.gz
sqlite-635e6a92a0a2ef0f97b6d1ab85d5eba1625d3cad.zip
Add support for "PRAGMA writable_schema=RESET".
FossilOrigin-Name: a51b305bd068f8d8e85b9fc38d61cdf5957f3a2ad2eb2e77015547910088e681
Diffstat (limited to 'src')
-rw-r--r--src/pragma.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pragma.c b/src/pragma.c
index 8bac04726..b997408b9 100644
--- a/src/pragma.c
+++ b/src/pragma.c
@@ -1117,6 +1117,14 @@ void sqlite3Pragma(
}else{
db->flags &= ~mask;
if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0;
+ if( (mask & SQLITE_WriteSchema)!=0
+ && sqlite3_stricmp(zRight, "reset")==0
+ ){
+ /* "PRAGMA writable_schema=RESET" turns schema writing off, just
+ ** like "PRAGMA writable_schema=OFF, but also causes the schema
+ ** to be reloaded. */
+ sqlite3ResetAllSchemasOfConnection(db);
+ }
}
/* Many of the flag-pragmas modify the code generated by the SQL