1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Avoid many unnecessary calls to sqlite3ReadSchema() and sqlite3Init() when

the schema is known to be valid already.

FossilOrigin-Name: 58cf812fd81329e82b3fdd61b7ad2040c9b90d2d80f592b9231e0e1902c8d577
This commit is contained in:
drh
2018-04-25 12:01:45 +00:00
parent 3215872446
commit b2c8559fad
7 changed files with 35 additions and 26 deletions

View File

@@ -158,7 +158,7 @@ static void attachFunc(
sqlite3_free( zPath );
db->nDb++;
}
db->skipBtreeMutex = 0;
db->noSharedCache = 0;
if( rc==SQLITE_CONSTRAINT ){
rc = SQLITE_ERROR;
zErrDyn = sqlite3MPrintf(db, "database is already attached");
@@ -230,6 +230,7 @@ static void attachFunc(
if( rc==SQLITE_OK ){
sqlite3BtreeEnterAll(db);
db->init.iDb = 0;
db->mDbFlags &= ~(DBFLAG_SchemaKnownOk);
rc = sqlite3Init(db, &zErrDyn);
sqlite3BtreeLeaveAll(db);
assert( zErrDyn==0 || rc!=SQLITE_OK );