/ Check-in [a4663f09]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:New checks in PRAGMA integrity_check to validate the autovacuum settings in the header.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:a4663f09c91d1381a831f61a2b8e8a113eb6083932c4aea2ad0c011ece1418c5
User & Date: drh 2018-07-20 15:44:09
Original Comment: New checked in PRAGMA integrity_check to validate the autovacuum settings in the header.
Context
2018-07-20
19:24
Change the SQLITE_Stat34 bit of the optimization test-control so that it prevents STAT4 data from being used but allows it to be loaded into the Index objects. This permits STAT4 to be turned on and off on a per-statement basis. check-in: 489f3caf user: drh tags: trunk
18:01
Experimental change to ANALYZE so that when computing values for sqlite_stat1, it uses the maximum number for the number of rows having equivalent values, rather than the average. Leaf check-in: 085f17e1 user: drh tags: stat1-max
15:44
New checks in PRAGMA integrity_check to validate the autovacuum settings in the header. check-in: a4663f09 user: drh tags: trunk
13:39
Enhanced detection of problems on the freelist and on overflow list in PRAGMA integrity_check. check-in: 11e58f5b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  9836   9836     sCheck.zPfx = "Main freelist: ";
  9837   9837     checkList(&sCheck, 1, get4byte(&pBt->pPage1->aData[32]),
  9838   9838               get4byte(&pBt->pPage1->aData[36]));
  9839   9839     sCheck.zPfx = 0;
  9840   9840   
  9841   9841     /* Check all the tables.
  9842   9842     */
         9843  +#ifndef SQLITE_OMIT_AUTOVACUUM
         9844  +  if( pBt->autoVacuum ){
         9845  +    int mx = 0;
         9846  +    int mxInHdr;
         9847  +    for(i=0; (int)i<nRoot; i++) if( mx<aRoot[i] ) mx = aRoot[i];
         9848  +    mxInHdr = get4byte(&pBt->pPage1->aData[52]);
         9849  +    if( mx!=mxInHdr ){
         9850  +      checkAppendMsg(&sCheck,
         9851  +        "max rootpage (%d) disagrees with header (%d)",
         9852  +        mx, mxInHdr
         9853  +      );
         9854  +    }
         9855  +  }else if( get4byte(&pBt->pPage1->aData[64])!=0 ){
         9856  +    checkAppendMsg(&sCheck,
         9857  +      "incremental_vacuum enabled with a max rootpage of zero"
         9858  +    );
         9859  +  }
         9860  +#endif
  9843   9861     testcase( pBt->db->flags & SQLITE_CellSizeCk );
  9844   9862     pBt->db->flags &= ~SQLITE_CellSizeCk;
  9845   9863     for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
  9846   9864       i64 notUsed;
  9847   9865       if( aRoot[i]==0 ) continue;
  9848   9866   #ifndef SQLITE_OMIT_AUTOVACUUM
  9849   9867       if( pBt->autoVacuum && aRoot[i]>1 ){