/ Check-in [a89f24e2]
Login

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

Overview
Comment:Remove dead code from the OP_JournalMode opcode in the VDBE. This code seems to have been useless since [f88c6367d2] on 2010-08-07.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a89f24e2c9591d09cbe329895ceec87885059184
User & Date: drh 2011-04-05 18:34:10
Original Comment: Remove dead code from the OP_JournalMode opcode in the VDBE. This code seems to have been useless since [f88c6367d2] on [20010-08-07].
Context
2011-04-05
19:26
Simplifications to the sqlite3ResetInternalSchema() logic to eliminate unreachable branches. check-in: a4c3ac98 user: drh tags: trunk
18:34
Remove dead code from the OP_JournalMode opcode in the VDBE. This code seems to have been useless since [f88c6367d2] on 2010-08-07. check-in: a89f24e2 user: drh tags: trunk
17:31
Remove the mutex counter and the logic that attempts to verify that btree mutexes are held continuously. We are not making that assumption at this time. check-in: 242ce7cf user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  5296   5296          || eNew==PAGER_JOURNALMODE_OFF
  5297   5297          || eNew==PAGER_JOURNALMODE_MEMORY
  5298   5298          || eNew==PAGER_JOURNALMODE_WAL
  5299   5299          || eNew==PAGER_JOURNALMODE_QUERY
  5300   5300     );
  5301   5301     assert( pOp->p1>=0 && pOp->p1<db->nDb );
  5302   5302   
  5303         -  /* This opcode is used in two places: PRAGMA journal_mode and ATTACH.
  5304         -  ** In PRAGMA journal_mode, the sqlite3VdbeUsesBtree() routine is called
  5305         -  ** when the statement is prepared and so p->btreeMask!=0.  All mutexes
  5306         -  ** are already acquired.  But when used in ATTACH, sqlite3VdbeUsesBtree()
  5307         -  ** is not called when the statement is prepared because it requires the
  5308         -  ** iDb index of the database as a parameter, and the database has not
  5309         -  ** yet been attached so that index is unavailable.  We have to wait
  5310         -  ** until runtime (now) to get the mutex on the newly attached database.
  5311         -  ** No other mutexes are required by the ATTACH command so this is safe
  5312         -  ** to do.
  5313         -  */
  5314         -  if( p->btreeMask==0 ){
  5315         -    /* This occurs right after ATTACH.  Get a mutex on the newly ATTACHed
  5316         -    ** database. */
  5317         -    sqlite3VdbeUsesBtree(p, pOp->p1);
  5318         -    sqlite3VdbeEnter(p);
  5319         -  }
  5320         -
  5321   5303     pBt = db->aDb[pOp->p1].pBt;
  5322   5304     pPager = sqlite3BtreePager(pBt);
  5323   5305     eOld = sqlite3PagerGetJournalMode(pPager);
  5324   5306     if( eNew==PAGER_JOURNALMODE_QUERY ) eNew = eOld;
  5325   5307     if( !sqlite3PagerOkToChangeJournalMode(pPager) ) eNew = eOld;
  5326   5308   
  5327   5309   #ifndef SQLITE_OMIT_WAL