/ Check-in [c0ee614f]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Avoid taking locks on unused database connections when committing a read transaction.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c0ee614fd988f445c4884a37f494479bdd669185
User & Date: drh 2010-10-14 01:17:30
Context
2010-10-21
02:05
Fix the query planner so that it uses the multi-index OR-clause solution if that is the lowest cost estimate. A prior bug cause the multi-index solution to be ignored in some circumstances. check-in: 28ba6255 user: drh tags: trunk
2010-10-19
14:08
Experimental changes to fts4 to try to selectively avoid loading very large doclists. check-in: 5ae0ba44 user: dan tags: experimental
2010-10-14
01:17
Avoid taking locks on unused database connections when committing a read transaction. check-in: c0ee614f user: drh tags: trunk
01:16
Check-in [d3c95e3a4e08d0] was incorrect. This is the correct fix for sqlit3_bind_blob(). Ticket [860399cc408f2dd5f4] check-in: ea8c2f5f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  3163   3163   ** the rollback journal (which causes the transaction to commit) and
  3164   3164   ** drop locks.
  3165   3165   **
  3166   3166   ** This will release the write lock on the database file.  If there
  3167   3167   ** are no active cursors, it also releases the read lock.
  3168   3168   */
  3169   3169   int sqlite3BtreeCommitPhaseTwo(Btree *p){
  3170         -  BtShared *pBt = p->pBt;
  3171   3170   
         3171  +  if( p->inTrans==TRANS_NONE ) return SQLITE_OK;
  3172   3172     sqlite3BtreeEnter(p);
  3173   3173     btreeIntegrity(p);
  3174   3174   
  3175   3175     /* If the handle has a write-transaction open, commit the shared-btrees 
  3176   3176     ** transaction and set the shared state to TRANS_READ.
  3177   3177     */
  3178   3178     if( p->inTrans==TRANS_WRITE ){
  3179   3179       int rc;
         3180  +    BtShared *pBt = p->pBt;
  3180   3181       assert( pBt->inTransaction==TRANS_WRITE );
  3181   3182       assert( pBt->nTransaction>0 );
  3182   3183       rc = sqlite3PagerCommitPhaseTwo(pBt->pPager);
  3183   3184       if( rc!=SQLITE_OK ){
  3184   3185         sqlite3BtreeLeave(p);
  3185   3186         return rc;
  3186   3187       }