/ Check-in [1fef7ad2]
Login

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

Overview
Comment:Fix the sqlite3BeginTrans() calls within the snapshot extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1fef7ad25b6a8e59163ac57f5cf0412bfc5b0e9446fd782f5f0a7d7ee11741fc
User & Date: drh 2018-06-06 18:50:50
Context
2018-06-06
19:48
Rearrange the order of some checks in the integrity_check pragma for a very slight performance gain. check-in: 4b853f02 user: drh tags: trunk
18:50
Fix the sqlite3BeginTrans() calls within the snapshot extension. check-in: 1fef7ad2 user: drh tags: trunk
17:45
Another minor optimization to OP_Transaction. check-in: d80077ae user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  4111   4111     sqlite3_mutex_enter(db->mutex);
  4112   4112   
  4113   4113     if( db->autoCommit==0 ){
  4114   4114       int iDb = sqlite3FindDbName(db, zDb);
  4115   4115       if( iDb==0 || iDb>1 ){
  4116   4116         Btree *pBt = db->aDb[iDb].pBt;
  4117   4117         if( 0==sqlite3BtreeIsInTrans(pBt) ){
  4118         -        rc = sqlite3BtreeBeginTrans(pBt, 0);
         4118  +        rc = sqlite3BtreeBeginTrans(pBt, 0, 0);
  4119   4119           if( rc==SQLITE_OK ){
  4120   4120             rc = sqlite3PagerSnapshotGet(sqlite3BtreePager(pBt), ppSnapshot);
  4121   4121           }
  4122   4122         }
  4123   4123       }
  4124   4124     }
  4125   4125   
................................................................................
  4149   4149       int iDb;
  4150   4150       iDb = sqlite3FindDbName(db, zDb);
  4151   4151       if( iDb==0 || iDb>1 ){
  4152   4152         Btree *pBt = db->aDb[iDb].pBt;
  4153   4153         if( 0==sqlite3BtreeIsInReadTrans(pBt) ){
  4154   4154           rc = sqlite3PagerSnapshotOpen(sqlite3BtreePager(pBt), pSnapshot);
  4155   4155           if( rc==SQLITE_OK ){
  4156         -          rc = sqlite3BtreeBeginTrans(pBt, 0);
         4156  +          rc = sqlite3BtreeBeginTrans(pBt, 0, 0);
  4157   4157             sqlite3PagerSnapshotOpen(sqlite3BtreePager(pBt), 0);
  4158   4158           }
  4159   4159         }
  4160   4160       }
  4161   4161     }
  4162   4162   
  4163   4163     sqlite3_mutex_leave(db->mutex);
................................................................................
  4181   4181   #endif
  4182   4182   
  4183   4183     sqlite3_mutex_enter(db->mutex);
  4184   4184     iDb = sqlite3FindDbName(db, zDb);
  4185   4185     if( iDb==0 || iDb>1 ){
  4186   4186       Btree *pBt = db->aDb[iDb].pBt;
  4187   4187       if( 0==sqlite3BtreeIsInReadTrans(pBt) ){
  4188         -      rc = sqlite3BtreeBeginTrans(pBt, 0);
         4188  +      rc = sqlite3BtreeBeginTrans(pBt, 0, 0);
  4189   4189         if( rc==SQLITE_OK ){
  4190   4190           rc = sqlite3PagerSnapshotRecover(sqlite3BtreePager(pBt));
  4191   4191           sqlite3BtreeCommit(pBt);
  4192   4192         }
  4193   4193       }
  4194   4194     }
  4195   4195     sqlite3_mutex_leave(db->mutex);