From 635e6a92a0a2ef0f97b6d1ab85d5eba1625d3cad Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 8 Oct 2021 16:39:33 +0000 Subject: [PATCH] Add support for "PRAGMA writable_schema=RESET". FossilOrigin-Name: a51b305bd068f8d8e85b9fc38d61cdf5957f3a2ad2eb2e77015547910088e681 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/pragma.c | 8 ++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index c6e13be900..704d5dd7de 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\sdetection\sof\sdatabase\scorruption. -D 2021-10-08T16:15:17.284 +C Add\ssupport\sfor\s"PRAGMA\swritable_schema=RESET". +D 2021-10-08T16:39:33.643 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -542,7 +542,7 @@ F src/parse.y 0bd7971a7489bbf6c3726f1b50da6e508bdff8fa493e9cc3f5a96b12cbb2361e F src/pcache.c 084e638432c610f95aea72b8509f0845d2791293f39d1b82f0c0a7e089c3bb6b F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586 F src/pcache1.c 54881292a9a5db202b2c0ac541c5e3ef9a5e8c4f1c1383adb2601d5499a60e65 -F src/pragma.c a2458437f99b356681ff3d699943e7f0eeb7ad0a00abf00df60fd8132d41f1c1 +F src/pragma.c 8d029903aac7d73ad9a304c32c98a0f65ec6fd3be37eae5d63a37900ace8e3b0 F src/pragma.h 87330ed2fbfa2a1274de93ca0ab850fba336189228cb256089202c3b52766fad F src/prepare.c 8f07616db04337057b8498b72d051ee90f73c54615c2e908c05404cef1e060b7 F src/printf.c 5901672228f305f7d493cbc4e7d76a61a5caecdbc1cd06b1f9ec42ea4265cf8d @@ -1928,7 +1928,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e77ac4050cf6c24118ce2af4c075f60e3eeb2dafe6d222c848bc4e541eef7172 -R 9bc76ad0c59bed7ccf95e6fe530b6c9c +P c7fae46c8a3bd78adc5a01340eff6c1efa75f9384dc7f42cb81717b029e7c56f +R c222db3e9e08c849b67cafc40e6de8c1 U drh -Z 057f03f7f6d5e1e4d7c402b7d6417858 +Z dd0d8cab0621c5c115ac8ea1cce302b4 diff --git a/manifest.uuid b/manifest.uuid index 73c25e7133..c6f8a8a75f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c7fae46c8a3bd78adc5a01340eff6c1efa75f9384dc7f42cb81717b029e7c56f \ No newline at end of file +a51b305bd068f8d8e85b9fc38d61cdf5957f3a2ad2eb2e77015547910088e681 \ No newline at end of file diff --git a/src/pragma.c b/src/pragma.c index 8bac047261..b997408b91 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