From 06ea8e899e48f1f2f396b70e63fae369f2f23232 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Mon, 28 Jun 2010 16:42:48 +0100 Subject: Merge WebKit at r61871: Initial merge by git. Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5 --- WebCore/storage/SQLStatement.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'WebCore/storage/SQLStatement.cpp') 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 -- cgit v1.1