1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Additional schema mutex checks for sqlite3RootPageMoved().

Reduce the scope of sqlite3ResetInternalSchema() in a few places.

FossilOrigin-Name: 39c00907833413c0d97d3e06fdda967b825d23ea
This commit is contained in:
drh
2011-04-04 21:25:28 +00:00
parent 9bbc2e283e
commit cdf011dcc4
6 changed files with 23 additions and 22 deletions

View File

@@ -472,6 +472,7 @@ static void schemaIsValid(Parse *pParse){
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie);
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
sqlite3ResetInternalSchema(db, iDb);
pParse->rc = SQLITE_SCHEMA;
}
@@ -613,9 +614,6 @@ static int sqlite3Prepare(
if( pParse->checkSchema ){
schemaIsValid(pParse);
}
if( pParse->rc==SQLITE_SCHEMA ){
sqlite3ResetInternalSchema(db, -1);
}
if( db->mallocFailed ){
pParse->rc = SQLITE_NOMEM;
}