/ Changes On Branch btree-debug
Login

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

Changes In Branch btree-debug Excluding Merge-Ins

This is equivalent to a diff from 12964240f1 to 214d238a47

2017-06-08
14:41
Merge the auto_vacuum bug fix and all other changes from the 3.19.3 release. (check-in: 93f32dd2dd user: drh tags: apple-osx)
2017-05-27
18:05
Add debugging functions btreePageOriginFile() and btreePageOriginOffset(). (Leaf check-in: 214d238a47 user: dan tags: btree-debug)
2017-05-25
17:36
Merge all fixes from the 3.19.2 release. (check-in: 12964240f1 user: drh tags: apple-osx)
16:50
Version 3.19.2 (check-in: edb4e819b0 user: drh tags: release, branch-3.19, version-3.19.2)
2017-05-22
19:24
Pull in all changes from the 3.19.0 release. (check-in: bbd2d0e140 user: drh tags: apple-osx)

Changes to src/btree.c.

   751    751   */
   752    752   void sqlite3BtreeClearCursor(BtCursor *pCur){
   753    753     assert( cursorHoldsMutex(pCur) );
   754    754     sqlite3_free(pCur->pKey);
   755    755     pCur->pKey = 0;
   756    756     pCur->eState = CURSOR_INVALID;
   757    757   }
          758  +
          759  +/*
          760  +** This is a debugging routine designed to reveal the file (database or
          761  +** wal file) that the page would be read from if it were reread at the 
          762  +** current time. It returns the name of the file.
          763  +*/
          764  +static const char *btreePageOriginFile(MemPage *pPage){
          765  +  return sqlite3PagerOrigin(pPage->pDbPage, 0);
          766  +}
          767  +
          768  +/*
          769  +** This is a debugging routine designed to reveal the byte offset that
          770  +** the page would be read from (from either the database or wal file) if it
          771  +** were reread at the current time. The byte offset is returned.
          772  +*/
          773  +static i64 btreePageOriginOffset(MemPage *pPage){
          774  +  i64 iOffset = 0;
          775  +  sqlite3PagerOrigin(pPage->pDbPage, &iOffset);
          776  +  return iOffset;
          777  +}
   758    778   
   759    779   /*
   760    780   ** In this version of BtreeMoveto, pKey is a packed index record
   761    781   ** such as is generated by the OP_MakeRecord opcode.  Unpack the
   762    782   ** record and then call BtreeMovetoUnpacked() to do the work.
   763    783   */
   764    784   static int btreeMoveto(

Changes to src/pager.c.

  7597   7597   ** is empty, return 0.
  7598   7598   */
  7599   7599   int sqlite3PagerWalFramesize(Pager *pPager){
  7600   7600     assert( pPager->eState>=PAGER_READER );
  7601   7601     return sqlite3WalFramesize(pPager->pWal);
  7602   7602   }
  7603   7603   #endif
         7604  +
         7605  +/*
         7606  +** Return the name of the file (wal file or database file) that page
         7607  +** pPg would be read from if it were reread at this point. Also set
         7608  +** output parameter (*piOffset) to the offset within said file.
         7609  +*/
         7610  +const char *sqlite3PagerOrigin(DbPage *pPg, i64 *piOffset){
         7611  +  Pager *pPager = pPg->pPager;
         7612  +  Pgno pgno = pPg->pgno;
         7613  +
         7614  +  assert( pPager->eState>=PAGER_READER );
         7615  +  assert( assert_pager_state(pPager) );
         7616  +  assert( pPager->hasHeldSharedLock==1 );
         7617  +
         7618  +  if( pagerUseWal(pPager) ){
         7619  +    u32 iFrame = 0;
         7620  +    int rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iFrame);
         7621  +    if( rc!=SQLITE_OK ) return 0;
         7622  +    if( iFrame ){
         7623  +      if( piOffset ) *piOffset = (i64)(iFrame-1) * (pPager->pageSize + 24) + 32;
         7624  +      return (const char*)pPager->zWal;
         7625  +    }
         7626  +  }
         7627  +
         7628  +  if( piOffset ) *piOffset = (i64)pPager->pageSize * (i64)(pgno-1);
         7629  +  return (const char*)pPager->zFilename;
         7630  +}
  7604   7631   
  7605   7632   #endif /* SQLITE_OMIT_DISKIO */

Changes to src/pager.h.

   232    232     void sqlite3PagerRefdump(Pager*);
   233    233     void disable_simulated_io_errors(void);
   234    234     void enable_simulated_io_errors(void);
   235    235   #else
   236    236   # define disable_simulated_io_errors()
   237    237   # define enable_simulated_io_errors()
   238    238   #endif
          239  +
          240  +const char *sqlite3PagerOrigin(DbPage *pPg, i64 *piOffset);
   239    241   
   240    242   #endif /* SQLITE_PAGER_H */