diff options
author | drh <drh@noemail.net> | 2011-04-05 13:12:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-04-05 13:12:28 +0000 |
commit | 959b6a95ee5f398ce3db3b3199f4e579e621e43c (patch) | |
tree | 732ad37cd655bc396a327918c6b60639937e6708 /src/vtab.c | |
parent | 8d129422ed9a04bac684864ba127fa6278cc7513 (diff) | |
parent | 03faf63b57a76c925c0e46e8bcb3b86cfe098590 (diff) | |
download | sqlite-959b6a95ee5f398ce3db3b3199f4e579e621e43c.tar.gz sqlite-959b6a95ee5f398ce3db3b3199f4e579e621e43c.zip |
Merge the scheme-parse-refactor changes into trunk: (1) added
sqlite3SchemaMutexHeld() asserts, (2) Use -1 instead of 0 to mean
"all" in sqlite3ResetInternalSchema(), and other cosmetic changes.
FossilOrigin-Name: 5db4511d8a77b74be3503a7c34257ef6b07541f5
Diffstat (limited to 'src/vtab.c')
-rw-r--r-- | src/vtab.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vtab.c b/src/vtab.c index b9f1e6f34..b052de23a 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -48,7 +48,7 @@ static int createModule( if( pDel==pMod ){ db->mallocFailed = 1; } - sqlite3ResetInternalSchema(db, 0); + sqlite3ResetInternalSchema(db, -1); }else if( xDestroy ){ xDestroy(pAux); } @@ -145,10 +145,9 @@ static VTable *vtabDisconnectAll(sqlite3 *db, Table *p){ ** that contains table p is held by the caller. See header comments ** above function sqlite3VtabUnlockList() for an explanation of why ** this makes it safe to access the sqlite3.pDisconnect list of any - ** database connection that may have an entry in the p->pVTable list. */ - assert( db==0 || - sqlite3BtreeHoldsMutex(db->aDb[sqlite3SchemaToIndex(db, p->pSchema)].pBt) - ); + ** database connection that may have an entry in the p->pVTable list. + */ + assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) ); while( pVTable ){ sqlite3 *db2 = pVTable->db; @@ -387,6 +386,7 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ Schema *pSchema = pTab->pSchema; const char *zName = pTab->zName; int nName = sqlite3Strlen30(zName); + assert( sqlite3SchemaMutexHeld(db, 0, pSchema) ); pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab); if( pOld ){ db->mallocFailed = 1; |