SQLite

Check-in [114640d920]
Login

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

Overview
Comment:Do not raise an SQLITE_CORRUPT error in Recoverymode if the database size in the header is larger than the physical file size. This facilitates recovery of a database in which the database size field has been corrupted.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 114640d920e16c85de90b19d53c485135875de5b
User & Date: drh 2011-01-12 17:56:26.948
References
2011-02-20
03:27
Do not raise an SQLITE_CORRUPT error in Recoverymode if the database size in the header is larger than the physical file size. This is a cherrypick of checkin [114640d920e16c8] (check-in: 7701b07759 user: drh tags: branch-3.7.4)
Context
2011-01-13
10:58
Fix a segfault that can occur in matchinfo if an fts4 table contains mostly zero-length documents. Specifically, if the table contains more rows than it does bytes of text. (check-in: fe9047668e user: dan tags: trunk)
2011-01-12
17:56
Do not raise an SQLITE_CORRUPT error in Recoverymode if the database size in the header is larger than the physical file size. This facilitates recovery of a database in which the database size field has been corrupted. (check-in: 114640d920 user: drh tags: trunk)
2011-01-11
17:40
Merge accidentally created fork. (check-in: b7d080b8e8 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
install-sh became executable.
Changes to src/btree.c.
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
      pBt->usableSize = usableSize;
      pBt->pageSize = pageSize;
      freeTempSpace(pBt);
      rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize,
                                   pageSize-usableSize);
      return rc;
    }
    if( nPageHeader>nPageFile ){
      rc = SQLITE_CORRUPT_BKPT;
      goto page1_init_failed;
    }
    if( usableSize<480 ){
      goto page1_init_failed;
    }
    pBt->pageSize = pageSize;







|







2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
      pBt->usableSize = usableSize;
      pBt->pageSize = pageSize;
      freeTempSpace(pBt);
      rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize,
                                   pageSize-usableSize);
      return rc;
    }
    if( (pBt->db->flags & SQLITE_RecoveryMode)==0 && nPageHeader>nPageFile ){
      rc = SQLITE_CORRUPT_BKPT;
      goto page1_init_failed;
    }
    if( usableSize<480 ){
      goto page1_init_failed;
    }
    pBt->pageSize = pageSize;
test/progress.test became a regular file.
tool/mkopts.tcl became a regular file.