aboutsummaryrefslogtreecommitdiff
path: root/src/attach.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-04-02 16:28:52 +0000
committerdrh <drh@noemail.net>2011-04-02 16:28:52 +0000
commitc7792fa052499f7ff04adaa787a957eb3f6b5e47 (patch)
tree534a9364433a4b5cfa8c6366c4107e492b08365e /src/attach.c
parent6c15487b7edf747b7b08cf6eb311f503adb0cd6a (diff)
downloadsqlite-c7792fa052499f7ff04adaa787a957eb3f6b5e47.tar.gz
sqlite-c7792fa052499f7ff04adaa787a957eb3f6b5e47.zip
Begin a series of changes designed to reduce the scope and frequency of
invalidating schemas. Design goals are that the internal schema should never be deleted out from under a prepared statement that is running and that all prepared statements should be expired if the schema is invalidated. At the same time, minimize the number of schema invalidations. This change merely revises the sqlite3ResetInternalSchema() function to use -1 as the wildcard for "all" rather than 0, so that we can reset the main schema independently of all the others. FossilOrigin-Name: 6a8ad6e31e0d2b8a5ace38faf0efd805155ee5f3
Diffstat (limited to 'src/attach.c')
-rw-r--r--src/attach.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/attach.c b/src/attach.c
index 37b61935f..fe88aa73c 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -200,7 +200,7 @@ static void attachFunc(
db->aDb[iDb].pBt = 0;
db->aDb[iDb].pSchema = 0;
}
- sqlite3ResetInternalSchema(db, 0);
+ sqlite3ResetInternalSchema(db, -1);
db->nDb = iDb;
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
db->mallocFailed = 1;
@@ -272,7 +272,7 @@ static void detachFunc(
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;
pDb->pSchema = 0;
- sqlite3ResetInternalSchema(db, 0);
+ sqlite3ResetInternalSchema(db, -1);
return;
detach_error: