/ 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 Unified Diffs Ignore Whitespace Patch

Changes to src/dbstat.c.

527
528
529
530
531
532
533




534
535
536
537
538
539
540
    if( !p->iRightChildPg || p->iCell>p->nCell ){
      statClearPage(p);
      if( pCsr->iPage==0 ) return statNext(pCursor);
      pCsr->iPage--;
      goto statNextRestart; /* Tail recursion */
    }
    pCsr->iPage++;




    assert( p==&pCsr->aPage[pCsr->iPage-1] );

    if( p->iCell==p->nCell ){
      p[1].iPgno = p->iRightChildPg;
    }else{
      p[1].iPgno = p->aCell[p->iCell].iChildPg;
    }







>
>
>
>







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

    if( p->iCell==p->nCell ){
      p[1].iPgno = p->iRightChildPg;
    }else{
      p[1].iPgno = p->aCell[p->iCell].iChildPg;
    }