/ Check-in [fc5ecc88]
Login

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

Overview
Comment:Improved database corruption detection in the dbstat virtual table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fc5ecc88f8a0855ba90039177ee284721b2035e4de56a1024e323216f011f0af
User & Date: drh 2019-01-09 11:19:41
Context
2019-01-09
14:49
Adjustments to the page cache to try to avoid harmless TSAN warnings. check-in: 383437be user: drh tags: trunk
11:19
Improved database corruption detection in the dbstat virtual table. check-in: fc5ecc88 user: drh tags: trunk
11:06
Small simplification to the dbstat virtual table. check-in: 9d4c156f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/dbstat.c.

   527    527       if( !p->iRightChildPg || p->iCell>p->nCell ){
   528    528         statClearPage(p);
   529    529         if( pCsr->iPage==0 ) return statNext(pCursor);
   530    530         pCsr->iPage--;
   531    531         goto statNextRestart; /* Tail recursion */
   532    532       }
   533    533       pCsr->iPage++;
          534  +    if( pCsr->iPage>=ArraySize(pCsr->aPage) ){
          535  +      statResetCsr(pCsr);
          536  +      return SQLITE_CORRUPT_BKPT;
          537  +    }
   534    538       assert( p==&pCsr->aPage[pCsr->iPage-1] );
   535    539   
   536    540       if( p->iCell==p->nCell ){
   537    541         p[1].iPgno = p->iRightChildPg;
   538    542       }else{
   539    543         p[1].iPgno = p->aCell[p->iCell].iChildPg;
   540    544       }