Avoid using sqlite3ResetAllSchemasOfConnection() purely for its side-effects.

FossilOrigin-Name: 5587c73badc07d3e01a7c5c5964e178b5112dd24
This commit is contained in:
drh 2012-05-16 01:24:34 +00:00
parent 81028a455d
commit 5efb314525
3 changed files with 15 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C The\sformer\ssqlite3ResetInternalSchema()\sroutine\swas\sreally\stwo\sdifferent\s\nroutines,\sselected\sby\sparameter,\seach\swith\sa\sconfused\smission.\s\sSo\ssplit\nthis\sroutine\sup\sinto\sthree\sseparate\ssmaller\sroutines,\scalling\seach\nseparately\sas\sneeded.\s\sHopefully\sthis\swill\smake\sfurther\srefactoring\sand\nschema\sreset\scollateral\sdamage\scontainment\seasier. C Avoid\susing\ssqlite3ResetAllSchemasOfConnection()\spurely\sfor\sits\sside-effects.
D 2012-05-15T18:28:27.325 D 2012-05-16T01:24:34.201
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20 F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -140,7 +140,7 @@ F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c 0ee69fca0be54cd93939df98d2aca4ca46f44416 F src/lempar.c 0ee69fca0be54cd93939df98d2aca4ca46f44416
F src/loadext.c f20382fbaeec832438a1ba7797bee3d3c8a6d51d F src/loadext.c f20382fbaeec832438a1ba7797bee3d3c8a6d51d
F src/main.c 28804c01149c1e707418434a42dc36438acdc5c8 F src/main.c 48f47554ccedb2e800aa8f5fb316835a584f709f
F src/malloc.c 15afac5e59b6584efe072e9933aefb4230e74f97 F src/malloc.c 15afac5e59b6584efe072e9933aefb4230e74f97
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c b3677415e69603d6a0e7c5410a1b3731d55beda1 F src/mem1.c b3677415e69603d6a0e7c5410a1b3731d55beda1
@ -998,7 +998,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh a8a0a3babda96dfb1ff51adda3cbbf3dfb7266c2 F tool/warnings-clang.sh a8a0a3babda96dfb1ff51adda3cbbf3dfb7266c2
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P 46f4eb5430d7bc9a339cdf7124ff4bd518eaa39b P aa0c3493d3647d7efe527067e9fcccefda8e3008
R 3470c7e3b0ec734f279c648e5bd9b93d R f77d3725cc1e7473c355856cafd6e6e6
U drh U drh
Z 93dd6b08b78f998064cdd25b32f8367e Z 8c590823c466df3da4ff72040b91d983

View File

@ -1 +1 @@
aa0c3493d3647d7efe527067e9fcccefda8e3008 5587c73badc07d3e01a7c5c5964e178b5112dd24

View File

@ -793,6 +793,7 @@ int sqlite3_close(sqlite3 *db){
/* Free any outstanding Savepoint structures. */ /* Free any outstanding Savepoint structures. */
sqlite3CloseSavepoints(db); sqlite3CloseSavepoints(db);
/* Close all database connections */
for(j=0; j<db->nDb; j++){ for(j=0; j<db->nDb; j++){
struct Db *pDb = &db->aDb[j]; struct Db *pDb = &db->aDb[j];
if( pDb->pBt ){ if( pDb->pBt ){
@ -803,10 +804,14 @@ int sqlite3_close(sqlite3 *db){
} }
} }
} }
/* Clear the TEMP schema separately and last */
if( db->aDb[1].pSchema ){
sqlite3SchemaClear(db->aDb[1].pSchema);
}
sqlite3VtabUnlockList(db);
/* This call frees the schema associated with the temp database only (if /* Free up the array of auxiliary databases */
** any). It also frees the db->aDb array, if required. */ sqlite3CollapseDatabaseArray(db);
sqlite3ResetAllSchemasOfConnection(db);
assert( db->nDb<=2 ); assert( db->nDb<=2 );
assert( db->aDb==db->aDbStatic ); assert( db->aDb==db->aDbStatic );