summaryrefslogtreecommitdiffstats
path: root/WebCore/storage/SQLStatement.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/storage/SQLStatement.cpp
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/storage/SQLStatement.cpp')
-rw-r--r--WebCore/storage/SQLStatement.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/WebCore/storage/SQLStatement.cpp b/WebCore/storage/SQLStatement.cpp
index cd96535..2d7d78e 100644
--- a/WebCore/storage/SQLStatement.cpp
+++ b/WebCore/storage/SQLStatement.cpp
@@ -78,7 +78,7 @@ bool SQLStatement::execute(Database* db)
if (result != SQLResultOk) {
LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database->lastErrorMsg());
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, database->lastErrorMsg());
return false;
}
@@ -86,7 +86,7 @@ bool SQLStatement::execute(Database* db)
// If this is the case, they might be trying to do something fishy or malicious
if (statement.bindParameterCount() != m_arguments.size()) {
LOG(StorageAPI, "Bind parameter count doesn't match number of question marks");
- m_error = SQLError::create(1, "number of '?'s in statement string does not match argument count");
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
return false;
}
@@ -99,7 +99,7 @@ bool SQLStatement::execute(Database* db)
if (result != SQLResultOk) {
LOG(StorageAPI, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, database->lastErrorMsg());
return false;
}
}
@@ -123,7 +123,7 @@ bool SQLStatement::execute(Database* db)
} while (result == SQLResultRow);
if (result != SQLResultDone) {
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, database->lastErrorMsg());
return false;
}
} else if (result == SQLResultDone) {
@@ -135,7 +135,7 @@ bool SQLStatement::execute(Database* db)
setFailureDueToQuota();
return false;
} else {
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, database->lastErrorMsg());
return false;
}
@@ -151,13 +151,13 @@ bool SQLStatement::execute(Database* db)
void SQLStatement::setDatabaseDeletedError()
{
ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(0, "unable to execute statement, because the user deleted the database");
+ m_error = SQLError::create(SQLError::UNKNOWN_ERR, "unable to execute statement, because the user deleted the database");
}
void SQLStatement::setVersionMismatchedError()
{
ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(2, "current version of the database and `oldVersion` argument do not match");
+ m_error = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
}
bool SQLStatement::performCallback(SQLTransaction* transaction)
@@ -184,7 +184,7 @@ bool SQLStatement::performCallback(SQLTransaction* transaction)
void SQLStatement::setFailureDueToQuota()
{
ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(4, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
+ m_error = SQLError::create(SQLError::QUOTA_ERR, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
}
void SQLStatement::clearFailureDueToQuota()
@@ -195,7 +195,7 @@ void SQLStatement::clearFailureDueToQuota()
bool SQLStatement::lastExecutionFailedDueToQuota() const
{
- return m_error && m_error->code() == 4;
+ return m_error && m_error->code() == SQLError::QUOTA_ERR;
}
} // namespace WebCore