From 5e2bc6953fe6923165b8a5d7679939693a1d58d6 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 5 Feb 2010 14:27:46 +0000 Subject: Merge webkit.org at r54340 : Initial merge by git Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44 --- WebCore/platform/sql/SQLiteTransaction.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'WebCore/platform/sql/SQLiteTransaction.cpp') diff --git a/WebCore/platform/sql/SQLiteTransaction.cpp b/WebCore/platform/sql/SQLiteTransaction.cpp index a4b2ac8..a34613f 100644 --- a/WebCore/platform/sql/SQLiteTransaction.cpp +++ b/WebCore/platform/sql/SQLiteTransaction.cpp @@ -64,6 +64,11 @@ void SQLiteTransaction::begin() void SQLiteTransaction::commit() { + // FIXME: this code is buggy; it assumes that COMMIT always succeeds which is not the case: + // the transaction could've been silently rolled back before getting to the COMMIT statement + // (https://bugs.webkit.org/show_bug.cgi?id=34280). However, the rest of the code does not + // know how to deal with a premature rollback and a failed COMMIT at this moment, so until + // we figure out what to do with bug 34280, it's better to leave this code as it is. if (m_inProgress) { ASSERT(m_db.m_transactionInProgress); m_db.executeCommand("COMMIT;"); @@ -84,8 +89,10 @@ void SQLiteTransaction::rollback() void SQLiteTransaction::stop() { - m_inProgress = false; - m_db.m_transactionInProgress = false; + if (m_inProgress) { + m_inProgress = false; + m_db.m_transactionInProgress = false; + } } } // namespace WebCore -- cgit v1.1