diff options
author | drh <drh@noemail.net> | 2018-07-20 15:44:09 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-07-20 15:44:09 +0000 |
commit | 040d77aa715cf24697e48e47a20b2302e3e48d27 (patch) | |
tree | a08cc8e0481831ab150fa485d37de27dee092ee5 /src/btree.c | |
parent | 91d5866eb6fad7341805ec1004b7b842c505a330 (diff) | |
download | sqlite-040d77aa715cf24697e48e47a20b2302e3e48d27.tar.gz sqlite-040d77aa715cf24697e48e47a20b2302e3e48d27.zip |
New checked in PRAGMA integrity_check to validate the autovacuum settings
in the header.
FossilOrigin-Name: a4663f09c91d1381a831f61a2b8e8a113eb6083932c4aea2ad0c011ece1418c5
Diffstat (limited to 'src/btree.c')
-rw-r--r-- | src/btree.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/btree.c b/src/btree.c index 45ff2bfe8..2fb528547 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9840,6 +9840,24 @@ char *sqlite3BtreeIntegrityCheck( /* Check all the tables. */ +#ifndef SQLITE_OMIT_AUTOVACUUM + if( pBt->autoVacuum ){ + int mx = 0; + int mxInHdr; + for(i=0; (int)i<nRoot; i++) if( mx<aRoot[i] ) mx = aRoot[i]; + mxInHdr = get4byte(&pBt->pPage1->aData[52]); + if( mx!=mxInHdr ){ + checkAppendMsg(&sCheck, + "max rootpage (%d) disagrees with header (%d)", + mx, mxInHdr + ); + } + }else if( get4byte(&pBt->pPage1->aData[64])!=0 ){ + checkAppendMsg(&sCheck, + "incremental_vacuum enabled with a max rootpage of zero" + ); + } +#endif testcase( pBt->db->flags & SQLITE_CellSizeCk ); pBt->db->flags &= ~SQLITE_CellSizeCk; for(i=0; (int)i<nRoot && sCheck.mxErr; i++){ |