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/pragma.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/pragma.c')
-rw-r--r-- | src/pragma.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pragma.c b/src/pragma.c index 9d3ec65f9..75ab26d44 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -115,7 +115,7 @@ static int invalidateTempStorage(Parse *pParse){ } sqlite3BtreeClose(db->aDb[1].pBt); db->aDb[1].pBt = 0; - sqlite3ResetInternalSchema(db, 0); + sqlite3ResetInternalSchema(db, -1); } return SQLITE_OK; } @@ -388,6 +388,7 @@ void sqlite3Pragma( sqlite3BeginWriteOperation(pParse, 0, iDb); sqlite3VdbeAddOp2(v, OP_Integer, size, 1); sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_DEFAULT_CACHE_SIZE, 1); + assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pDb->pSchema->cache_size = size; sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size); } @@ -690,6 +691,7 @@ void sqlite3Pragma( */ if( sqlite3StrICmp(zLeft,"cache_size")==0 ){ if( sqlite3ReadSchema(pParse) ) goto pragma_out; + assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( !zRight ){ returnSingleInt(pParse, "cache_size", pDb->pSchema->cache_size); }else{ @@ -1110,6 +1112,7 @@ void sqlite3Pragma( ** Begin by filling registers 2, 3, ... with the root pages numbers ** for all tables and indices in the database. */ + assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pTbls = &db->aDb[i].pSchema->tblHash; for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ Table *pTab = sqliteHashData(x); |