/ Check-in [6f330501]
Login

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

Overview
Comment:Hold the database mutex for the duration of sqlite3session_diff().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1: 6f33050115562833c43da3c99dd37aeb0bf966b6
User & Date: dan 2015-04-17 11:31:08
Context
2015-04-20
01:32
Merge all recent trunk enhancements and fixes into the sessions branch. check-in: b8ef1cde user: drh tags: sessions
2015-04-17
11:31
Hold the database mutex for the duration of sqlite3session_diff(). check-in: 6f330501 user: dan tags: sessions
2015-04-16
13:52
Fix a stray backslash character in a printf format string in sessionDiffFindModified() check-in: abb192a1 user: drh tags: sessions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/session/sqlite3session.c.

  1451   1451     const char *zDb = pSession->zDb;
  1452   1452     int rc = pSession->rc;
  1453   1453     SessionDiffCtx d;
  1454   1454   
  1455   1455     memset(&d, 0, sizeof(d));
  1456   1456     sessionDiffHooks(pSession, &d);
  1457   1457   
         1458  +  sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
  1458   1459     if( pzErrMsg ) *pzErrMsg = 0;
  1459   1460     if( rc==SQLITE_OK ){
  1460   1461       char *zExpr = 0;
  1461   1462       sqlite3 *db = pSession->db;
  1462   1463       SessionTable *pTo;            /* Table zTbl */
  1463   1464   
  1464   1465       /* Locate and if necessary initialize the target table object */
................................................................................
  1517   1518       }
  1518   1519   
  1519   1520       sqlite3_free(zExpr);
  1520   1521     }
  1521   1522   
  1522   1523    diff_out:
  1523   1524     sessionPreupdateHooks(pSession);
         1525  +  sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
  1524   1526     return rc;
  1525   1527   }
  1526   1528   
  1527   1529   /*
  1528   1530   ** Create a session object. This session object will record changes to
  1529   1531   ** database zDb attached to connection db.
  1530   1532   */