/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/vdbe.c.

5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
       || eNew==PAGER_JOURNALMODE_OFF
       || eNew==PAGER_JOURNALMODE_MEMORY
       || eNew==PAGER_JOURNALMODE_WAL
       || eNew==PAGER_JOURNALMODE_QUERY
  );
  assert( pOp->p1>=0 && pOp->p1<db->nDb );

  /* This opcode is used in two places: PRAGMA journal_mode and ATTACH.
  ** In PRAGMA journal_mode, the sqlite3VdbeUsesBtree() routine is called
  ** when the statement is prepared and so p->btreeMask!=0.  All mutexes
  ** are already acquired.  But when used in ATTACH, sqlite3VdbeUsesBtree()
  ** is not called when the statement is prepared because it requires the
  ** iDb index of the database as a parameter, and the database has not
  ** yet been attached so that index is unavailable.  We have to wait
  ** until runtime (now) to get the mutex on the newly attached database.
  ** No other mutexes are required by the ATTACH command so this is safe
  ** to do.
  */
  if( p->btreeMask==0 ){
    /* This occurs right after ATTACH.  Get a mutex on the newly ATTACHed
    ** database. */
    sqlite3VdbeUsesBtree(p, pOp->p1);
    sqlite3VdbeEnter(p);
  }

  pBt = db->aDb[pOp->p1].pBt;
  pPager = sqlite3BtreePager(pBt);
  eOld = sqlite3PagerGetJournalMode(pPager);
  if( eNew==PAGER_JOURNALMODE_QUERY ) eNew = eOld;
  if( !sqlite3PagerOkToChangeJournalMode(pPager) ) eNew = eOld;

#ifndef SQLITE_OMIT_WAL







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







5296
5297
5298
5299
5300
5301
5302


















5303
5304
5305
5306
5307
5308
5309
       || eNew==PAGER_JOURNALMODE_OFF
       || eNew==PAGER_JOURNALMODE_MEMORY
       || eNew==PAGER_JOURNALMODE_WAL
       || eNew==PAGER_JOURNALMODE_QUERY
  );
  assert( pOp->p1>=0 && pOp->p1<db->nDb );



















  pBt = db->aDb[pOp->p1].pBt;
  pPager = sqlite3BtreePager(pBt);
  eOld = sqlite3PagerGetJournalMode(pPager);
  if( eNew==PAGER_JOURNALMODE_QUERY ) eNew = eOld;
  if( !sqlite3PagerOkToChangeJournalMode(pPager) ) eNew = eOld;

#ifndef SQLITE_OMIT_WAL