Commit cc3cc69a authored by Shawn Wilsher's avatar Shawn Wilsher
Browse files

Bug 571599 - Use sqlite3_unlock_notify

sr=vlad
r=bent
r=asuth
parent cf22f0db
Loading
Loading
Loading
Loading
+30 −1
Original line number Diff line number Diff line
@@ -6703,7 +6703,7 @@ else
    dnl === SQLITE_ENABLE_FTS3 check ===
    dnl ================================
    dnl check to see if the system SQLite package is compiled with
    dnl SQLITE_THREADSAFE enabled.
    dnl SQLITE_ENABLE_FTS3 enabled.
    AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
@@ -6727,6 +6727,35 @@ else
    if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
        AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
    fi

    dnl =========================================
    dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
    dnl =========================================
    dnl check to see if the system SQLite package is compiled with
    dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
    AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
        AC_TRY_RUN([
            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
            }],
            ac_cv_sqlite_enable_unlock_notify=yes,
            ac_cv_sqlite_enable_unlock_notify=no,
            ac_cv_sqlite_enable_unlock_notify=no
        )
    ])
    AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
        AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
    fi
fi

AC_SUBST(MOZ_NATIVE_SQLITE)
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ DEFINES = \
  -DSQLITE_THREADSAFE=1 \
  -DSQLITE_CORE=1 \
  -DSQLITE_ENABLE_FTS3=1 \
  -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
  $(NULL)

# -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ EXPORTS
        sqlite3_total_changes
        sqlite3_trace
        sqlite3_transfer_bindings
        sqlite3_unlock_notify
        sqlite3_update_hook
        sqlite3_user_data
        sqlite3_value_blob
+2 −3
Original line number Diff line number Diff line
@@ -332,9 +332,8 @@ AsyncStatement::getAsyncStatement(sqlite3_stmt **_stmt)
#endif

  if (!mAsyncStatement) {
    int rc = ::sqlite3_prepare_v2(mDBConnection->GetNativeConnection(),
                                  mSQLString.get(), -1,
                                  &mAsyncStatement, NULL);
    int rc = prepareStmt(mDBConnection->GetNativeConnection(), mSQLString,
                         &mAsyncStatement);
    if (rc != SQLITE_OK) {
#ifdef PR_LOGGING
      PR_LOG(gStorageLog, PR_LOG_ERROR,
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ AsyncExecuteStatements::executeStatement(sqlite3_stmt *aStatement)
    // lock the sqlite mutex so sqlite3_errmsg cannot change
    SQLiteMutexAutoLock lockedScope(mDBMutex);

    int rc = ::sqlite3_step(aStatement);
    int rc = stepStmt(aStatement);
    // Stop if we have no more results.
    if (rc == SQLITE_DONE)
      return false;
Loading