SQLite

Check-in [30735432]
Login

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

Overview
Comment:Improved detection of a corrupt database schema. Fix for a problem discovered by dbsqlfuzz.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 30735432bc33cb953b6d7d2a2de9eb378f9740e0e663f50c727c3f138cd43a2b
User & Date: drh 2020-07-11 16:42:28
References
2020-07-11
16:45
Add second test case for the improvement in [30735432]. (check-in: 1bd18ca3 user: dan tags: trunk)
Context
2020-07-11
16:45
Add second test case for the improvement in [30735432]. (check-in: 1bd18ca3 user: dan tags: trunk)
16:42
Improved detection of a corrupt database schema. Fix for a problem discovered by dbsqlfuzz. (check-in: 30735432 user: drh tags: trunk)
2020-07-10
21:43
Remove unnecessary code from the window functions implementation. (check-in: 1e87da9c user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/btree.c.

8768
8769
8770
8771
8772
8773
8774



8775

8776
8777
8778
8779
8780
8781
8782
       || (pCur->eState==CURSOR_INVALID && loc)
       || CORRUPT_DB );

  pPage = pCur->pPage;
  assert( pPage->intKey || pX->nKey>=0 );
  assert( pPage->leaf || !pPage->intKey );
  if( pPage->nFree<0 ){



    rc = btreeComputeFreeSpace(pPage);

    if( rc ) return rc;
  }

  TRACE(("INSERT: table=%d nkey=%lld ndata=%d page=%d %s\n",
          pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
          loc==0 ? "overwrite" : "new entry"));
  assert( pPage->isInit );







>
>
>
|
>







8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
       || (pCur->eState==CURSOR_INVALID && loc)
       || CORRUPT_DB );

  pPage = pCur->pPage;
  assert( pPage->intKey || pX->nKey>=0 );
  assert( pPage->leaf || !pPage->intKey );
  if( pPage->nFree<0 ){
    if( pCur->eState>CURSOR_INVALID ){
      rc = SQLITE_CORRUPT_BKPT;
    }else{
      rc = btreeComputeFreeSpace(pPage);
    }
    if( rc ) return rc;
  }

  TRACE(("INSERT: table=%d nkey=%lld ndata=%d page=%d %s\n",
          pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
          loc==0 ? "overwrite" : "new entry"));
  assert( pPage->isInit );

Changes to test/fuzzdata8.db.

cannot compute difference between binary files