1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add an "|| CORRUPT_DB" term to an assert() statement inside of btree.

FossilOrigin-Name: 03c1d75ddc063469fc856114595bd12d21759fe0979ce1ba1cf52e48e6b0d4a1
This commit is contained in:
drh
2020-01-07 13:32:15 +00:00
parent 262efe4a43
commit 42925d1f1a
4 changed files with 11 additions and 11 deletions

View File

@@ -2137,11 +2137,11 @@ static MemPage *btreePageLookup(BtShared *pBt, Pgno pgno){
** error, return ((unsigned int)-1).
*/
static Pgno btreePagecount(BtShared *pBt){
return pBt->nPage;
assert( (pBt->nPage & 0x80000000)==0 || CORRUPT_DB );
return pBt->nPage & 0x7fffffff;
}
u32 sqlite3BtreeLastPage(Btree *p){
assert( sqlite3BtreeHoldsMutex(p) );
assert( ((p->pBt->nPage)&0x80000000)==0 );
return btreePagecount(p->pBt);
}