mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1067054
- Remove generic SQLITE_ERROR warning & suppress warning if transaction exists. r=mak
--HG-- extra : rebase_source : 126e1918f828eef3374968cde8ca394a0f856376
This commit is contained in:
parent
6e98a99ffd
commit
8f1a6fdc91
@ -586,7 +586,7 @@ AsyncExecuteStatements::Run()
|
||||
if (mState == CANCELED)
|
||||
return notifyComplete();
|
||||
|
||||
if (statementsNeedTransaction()) {
|
||||
if (statementsNeedTransaction() && mConnection->getAutocommit()) {
|
||||
if (NS_SUCCEEDED(mConnection->beginTransactionInternal(mNativeConnection,
|
||||
mozIStorageConnection::TRANSACTION_IMMEDIATE))) {
|
||||
mHasTransaction = true;
|
||||
|
@ -124,8 +124,7 @@ public:
|
||||
* Gets autocommit status.
|
||||
*/
|
||||
bool getAutocommit() {
|
||||
MOZ_ASSERT(mDBConn, "A connection must exist at this point");
|
||||
return static_cast<bool>(::sqlite3_get_autocommit(mDBConn));
|
||||
return mDBConn && static_cast<bool>(::sqlite3_get_autocommit(mDBConn));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ convertResultCode(int aSQLiteResultCode)
|
||||
message.AppendLiteral("SQLite returned error code ");
|
||||
message.AppendInt(rc);
|
||||
message.AppendLiteral(" , Storage will convert it to NS_ERROR_FAILURE");
|
||||
NS_WARNING(message.get());
|
||||
NS_WARN_IF_FALSE(rc == SQLITE_ERROR, message.get());
|
||||
#endif
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user