/ Check-in [395f8ea7]
Login

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

Overview
Comment:Avoid unnecessary OOM detection warnings in a debugging routine.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:395f8ea790e6e295800fa8927f0585b2419b9521ef4fd591d51d2a48db2a90c4
User & Date: drh 2018-01-22 15:45:12
Context
2018-01-22
18:45
Version 3.22.0 check-in: 0c55d179 user: drh tags: trunk, release, version-3.22.0
15:45
Avoid unnecessary OOM detection warnings in a debugging routine. check-in: 395f8ea7 user: drh tags: trunk
15:20
Fix a test case in walro2.test so that it works with encryption extensions (when each page has a little less usable space available than usual). check-in: b79521d2 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

   119    119   ** If SQLITE_DEBUG is not defined, then this macro is equivalent to
   120    120   ** SQLITE_CORRUPT_BKPT. Or, if SQLITE_DEBUG is set, then the log message
   121    121   ** normally produced as a side-effect of SQLITE_CORRUPT_BKPT is augmented
   122    122   ** with the page number and filename associated with the (MemPage*).
   123    123   */
   124    124   #ifdef SQLITE_DEBUG
   125    125   int corruptPageError(int lineno, MemPage *p){
   126         -  char *zMsg = sqlite3_mprintf("database corruption page %d of %s",
          126  +  char *zMsg;
          127  +  sqlite3BeginBenignMalloc();
          128  +  zMsg = sqlite3_mprintf("database corruption page %d of %s",
   127    129         (int)p->pgno, sqlite3PagerFilename(p->pBt->pPager, 0)
   128    130     );
          131  +  sqlite3EndBenignMalloc();
   129    132     if( zMsg ){
   130    133       sqlite3ReportError(SQLITE_CORRUPT, lineno, zMsg);
   131    134     }
   132    135     sqlite3_free(zMsg);
   133    136     return SQLITE_CORRUPT_BKPT;
   134    137   }
   135    138   # define SQLITE_CORRUPT_PAGE(pMemPage) corruptPageError(__LINE__, pMemPage)