SQLite

Check-in [59f75bba02]
Login

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

Overview
Comment:Store the database size in pages in bytes 28..31 of the header. Currently this is for forensic use only, but it might be used in the future.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59f75bba028e1107ed41d447c27aef31a6656b68
User & Date: drh 2010-03-13 02:15:49.000
Context
2010-03-15
19:27
Fix FTS3 so that it does not run illegal SQL and cause a spurious log message. Ticket [42d45a693e6]. (check-in: f186b6a619 user: drh tags: trunk)
2010-03-13
02:15
Store the database size in pages in bytes 28..31 of the header. Currently this is for forensic use only, but it might be used in the future. (check-in: 59f75bba02 user: drh tags: trunk)
2010-03-12
16:32
Add assert()s to mem2.c (activated by SQLITE_MEMDEBUG) which verify that memory alloctions that might have come from lookaside are always freed using a lookaside-aware free routine. (check-in: c2af2164cf user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/pager.c.
4484
4485
4486
4487
4488
4489
4490




4491
4492
4493
4494
4495
4496
4497
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501







+
+
+
+







    }

    if( rc==SQLITE_OK ){
      /* Increment the value just read and write it back to byte 24. */
      change_counter = sqlite3Get4byte((u8*)pPager->dbFileVers);
      change_counter++;
      put32bits(((char*)pPgHdr->pData)+24, change_counter);

      /* Also store the current database size in bytes 28..31 */
      assert( pPager->dbSizeValid );
      put32bits(((char*)pPgHdr->pData)+28, pPager->dbSize);

      /* If running in direct mode, write the contents of page 1 to the file. */
      if( DIRECT_MODE ){
        const void *zBuf = pPgHdr->pData;
        assert( pPager->dbFileSize>0 );
        rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0);
        if( rc==SQLITE_OK ){