summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/sql/SQLiteTransaction.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-05 14:27:46 +0000
committerSteve Block <steveblock@google.com>2010-02-15 10:49:50 +0000
commit5e2bc6953fe6923165b8a5d7679939693a1d58d6 (patch)
tree6ccb8c24bc2bf5e8f413e6cfae250b729b426631 /WebCore/platform/sql/SQLiteTransaction.cpp
parent4a00f4fccc3cb7e9996749a05631f5d7b9de756e (diff)
downloadexternal_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.zip
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.gz
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.bz2
Merge webkit.org at r54340 : Initial merge by git
Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44
Diffstat (limited to 'WebCore/platform/sql/SQLiteTransaction.cpp')
-rw-r--r--WebCore/platform/sql/SQLiteTransaction.cpp11
1 files changed, 9 insertions, 2 deletions
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