summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/sql/SQLiteDatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/sql/SQLiteDatabase.cpp')
-rw-r--r--Source/WebCore/platform/sql/SQLiteDatabase.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/WebCore/platform/sql/SQLiteDatabase.cpp b/Source/WebCore/platform/sql/SQLiteDatabase.cpp
index 8ab626b12..2418fc12c 100644
--- a/Source/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/Source/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -45,6 +45,7 @@ const int SQLResultRow = SQLITE_ROW;
const int SQLResultSchema = SQLITE_SCHEMA;
const int SQLResultFull = SQLITE_FULL;
const int SQLResultInterrupt = SQLITE_INTERRUPT;
+const int SQLResultConstraint = SQLITE_CONSTRAINT;
static const char notOpenErrorMessage[] = "database is not open";
@@ -57,6 +58,7 @@ SQLiteDatabase::SQLiteDatabase()
, m_interrupted(false)
, m_openError(SQLITE_ERROR)
, m_openErrorMessage()
+ , m_lastChangesCount(0)
{
}
@@ -320,11 +322,20 @@ int64_t SQLiteDatabase::lastInsertRowID()
return sqlite3_last_insert_rowid(m_db);
}
+void SQLiteDatabase::updateLastChangesCount()
+{
+ if (!m_db)
+ return;
+
+ m_lastChangesCount = sqlite3_total_changes(m_db);
+}
+
int SQLiteDatabase::lastChanges()
{
if (!m_db)
return 0;
- return sqlite3_changes(m_db);
+
+ return sqlite3_total_changes(m_db) - m_lastChangesCount;
}
int SQLiteDatabase::lastError()