/ Check-in [59f75bba]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59f75bba028e1107ed41d447c27aef31a6656b68
User & Date: drh 2010-03-13 02:15:49
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: f186b6a6 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: 59f75bba 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: c2af2164 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  4484   4484       }
  4485   4485   
  4486   4486       if( rc==SQLITE_OK ){
  4487   4487         /* Increment the value just read and write it back to byte 24. */
  4488   4488         change_counter = sqlite3Get4byte((u8*)pPager->dbFileVers);
  4489   4489         change_counter++;
  4490   4490         put32bits(((char*)pPgHdr->pData)+24, change_counter);
         4491  +
         4492  +      /* Also store the current database size in bytes 28..31 */
         4493  +      assert( pPager->dbSizeValid );
         4494  +      put32bits(((char*)pPgHdr->pData)+28, pPager->dbSize);
  4491   4495   
  4492   4496         /* If running in direct mode, write the contents of page 1 to the file. */
  4493   4497         if( DIRECT_MODE ){
  4494   4498           const void *zBuf = pPgHdr->pData;
  4495   4499           assert( pPager->dbFileSize>0 );
  4496   4500           rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0);
  4497   4501           if( rc==SQLITE_OK ){