/ Check-in [5a9e7463]
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:Omit some code that is not used when SQLITE_SECURE_DELETE is defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5a9e746357aa8edeef6b89f01e19cd57555bef32
User & Date: drh 2009-11-10 01:12:51
Context
2009-11-10
01:13
Remove from the TCL interface some old code associated with sqlite3_analyzer. check-in: 01f2271e user: drh tags: trunk
01:12
Omit some code that is not used when SQLITE_SECURE_DELETE is defined. check-in: 5a9e7463 user: drh tags: trunk
2009-11-06
17:20
Improved shell "dot" command argument handling. Ticket [f12a9eeedc]. check-in: 9fb69919 user: shaneh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  2869   2869   
  2870   2870       /* If there are dirty pages in the page cache with page numbers greater
  2871   2871       ** than Pager.dbSize, this means sqlite3PagerTruncateImage() was called to
  2872   2872       ** make the file smaller (presumably by auto-vacuum code). Do not write
  2873   2873       ** any such pages to the file.
  2874   2874       **
  2875   2875       ** Also, do not write out any page that has the PGHDR_DONT_WRITE flag
  2876         -    ** set (set by sqlite3PagerDontWrite()).
         2876  +    ** set (set by sqlite3PagerDontWrite()).  Note that if compiled with
         2877  +    ** SQLITE_SECURE_DELETE the PGHDR_DONT_WRITE bit is never set and so
         2878  +    ** the second test is always true.
  2877   2879       */
  2878   2880       if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){
  2879   2881         i64 offset = (pgno-1)*(i64)pPager->pageSize;   /* Offset to write */
  2880   2882         char *pData;                                   /* Data to write */    
  2881   2883   
  2882   2884         /* Encode the database */
  2883   2885         CODEC2(pPager, pList->pData, pgno, 6, return SQLITE_NOMEM, pData);
................................................................................
  4378   4380   */
  4379   4381   #ifndef NDEBUG
  4380   4382   int sqlite3PagerIswriteable(DbPage *pPg){
  4381   4383     return pPg->flags&PGHDR_DIRTY;
  4382   4384   }
  4383   4385   #endif
  4384   4386   
         4387  +#ifndef SQLITE_SECURE_DELETE
  4385   4388   /*
  4386   4389   ** A call to this routine tells the pager that it is not necessary to
  4387   4390   ** write the information on page pPg back to the disk, even though
  4388   4391   ** that page might be marked as dirty.  This happens, for example, when
  4389   4392   ** the page has been added as a leaf of the freelist and so its
  4390   4393   ** content no longer matters.
  4391   4394   **
................................................................................
  4403   4406       IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno))
  4404   4407       pPg->flags |= PGHDR_DONT_WRITE;
  4405   4408   #ifdef SQLITE_CHECK_PAGES
  4406   4409       pPg->pageHash = pager_pagehash(pPg);
  4407   4410   #endif
  4408   4411     }
  4409   4412   }
         4413  +#endif /* !defined(SQLITE_SECURE_DELETE) */
  4410   4414   
  4411   4415   /*
  4412   4416   ** This routine is called to increment the value of the database file 
  4413   4417   ** change-counter, stored as a 4-byte big-endian integer starting at 
  4414   4418   ** byte offset 24 of the pager file.
  4415   4419   **
  4416   4420   ** If the isDirectMode flag is zero, then this is done by calling