From: drh Date: Thu, 12 Nov 2015 22:15:18 +0000 (+0000) Subject: Always parse the schema *before* running "PRAGMA cache_size", not after. X-Git-Tag: version-3.10.0~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d4482da96cac095da7bae205ae4cf1136855951;p=thirdparty%2Fsqlite.git Always parse the schema *before* running "PRAGMA cache_size", not after. FossilOrigin-Name: 12e7d9ec023db4dd837f76006c87defc5a3e9388 --- diff --git a/manifest b/manifest index 3af41656d6..e33255648a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\sspace\sbefore\seach\sline\sof\serror\soutput\sin\sthe\stest\sscripts\sso\sthat\sall\nerrors\scan\sbe\sconveniently\slocated\sin\slogs\sby\sdoing\s"grep\s'^\s'". -D 2015-11-12T21:42:40.423 +C Always\sparse\sthe\sschema\s*before*\srunning\s"PRAGMA\scache_size",\snot\safter. +D 2015-11-12T22:15:18.738 F Makefile.in d828db6afa6c1fa060d01e33e4674408df1942a1 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc e928e68168df69b353300ac87c10105206653a03 @@ -332,8 +332,8 @@ F src/parse.y aad5cc866dc23719f361fe7e0b8eaec8ce4861a4 F src/pcache.c 73895411fa6b7bd6f0091212feabbe833b358d23 F src/pcache.h 1ff11adce609ba7de139b6abfabaf9a2bac947b5 F src/pcache1.c 902e1bc7bdaa81b40f8543407c5e2ac8ef4dc035 -F src/pragma.c 56161e4aa4891a45b534f6516acb343df15a5120 -F src/pragma.h 31b110aaecb5603829c97747b99abfe491df5fa0 +F src/pragma.c f3e7147299ca05ef4304a36f1fd6e002729c72c6 +F src/pragma.h 3d94aebbebd2089899fecc01909bf2608b39507d F src/prepare.c 82e5db1013846a819f198336fed72c44c974e7b1 F src/printf.c 0c4bcdd1c2e2521024f0a69cb5eb334f86b3652a F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 @@ -1365,7 +1365,7 @@ F tool/mkkeywordhash.c 37f9c2e62c31384b697ede8825e2d344e98db22c F tool/mkopcodec.tcl edde8adc42621b5e598127f8cdc6d52cfe21f52b F tool/mkopcodeh.tcl e04177031532b7aa9379ded50e820231ac4abd6e F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e -F tool/mkpragmatab.tcl 473b6a156bc018d36aac5288d8479a879d570b93 +F tool/mkpragmatab.tcl e94e55d247d4fe3be34f2a4f4edb03fdcd09ce5b F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 87240b09c20042999b41d5fabe091b7111287835 F tool/mksqlite3c.tcl b66b4170f693602cd6985aed15d9509fe2f18c84 @@ -1403,7 +1403,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P cab8126be9f63dd596719b12704ba77c128282bc -R 285b415177be5b2cab525b82d9f69ae9 +P 9d532fb50d310df629ea65193f21dc9b3594ff5f +R c87ef7443677f3561dc0db07fe8b69b1 U drh -Z a7a38819a361f89adc4ae5f714679f1c +Z df246221f99363b8ea6311e003f21bb5 diff --git a/manifest.uuid b/manifest.uuid index 093fb4fd1f..e10ef9ff00 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9d532fb50d310df629ea65193f21dc9b3594ff5f \ No newline at end of file +12e7d9ec023db4dd837f76006c87defc5a3e9388 \ No newline at end of file diff --git a/src/pragma.c b/src/pragma.c index 792f4f7e32..0d48057d21 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -735,13 +735,11 @@ void sqlite3Pragma( case PragTyp_CACHE_SIZE: { assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( !zRight ){ - if( sqlite3ReadSchema(pParse) ) goto pragma_out; returnSingleInt(v, "cache_size", pDb->pSchema->cache_size); }else{ int size = sqlite3Atoi(zRight); pDb->pSchema->cache_size = size; sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size); - if( sqlite3ReadSchema(pParse) ) goto pragma_out; } break; } diff --git a/src/pragma.h b/src/pragma.h index 1bb6691224..24a6c9d710 100644 --- a/src/pragma.h +++ b/src/pragma.h @@ -87,7 +87,7 @@ static const struct sPragmaNames { #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) { /* zName: */ "cache_size", /* ePragTyp: */ PragTyp_CACHE_SIZE, - /* ePragFlag: */ 0, + /* ePragFlag: */ PragFlag_NeedSchema, /* iArg: */ 0 }, #endif #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) diff --git a/tool/mkpragmatab.tcl b/tool/mkpragmatab.tcl index 9e0c7d5153..bcd3ed5d86 100644 --- a/tool/mkpragmatab.tcl +++ b/tool/mkpragmatab.tcl @@ -168,6 +168,7 @@ set pragma_def { IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS) NAME: cache_size + FLAG: NeedSchema IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS) NAME: mmap_size