From bed29d94d90663ab161e5832677dae9dd4d4be13 Mon Sep 17 00:00:00 2001 From: "gbillock@chromium.org" Date: Thu, 22 Dec 2011 19:25:51 +0000 Subject: Update webdata files to take advantage of DLOG(FATAL) in sql/Statement and Connection. R=shess@chromium.org BUG= TEST=webdata/*Test*.* Review URL: http://codereview.chromium.org/8966003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115574 0039d316-1c4b-4281-b951-d872f2087c98 --- sql/statement.cc | 5 +++++ sql/statement.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/statement.cc b/sql/statement.cc index fd73b0f..a5daae4 100644 --- a/sql/statement.cc +++ b/sql/statement.cc @@ -256,6 +256,11 @@ const char* Statement::GetSQLStatement() { } bool Statement::CheckOk(int err) const { + // Binding to a non-existent variable is evidence of a serious error. + // TODO(gbillock,shess): make this invalidate the statement so it + // can't wreak havoc. + if (err == SQLITE_RANGE) + DLOG(FATAL) << "Bind value out of range"; return err == SQLITE_OK; } diff --git a/sql/statement.h b/sql/statement.h index 97fdb5e..c7e2c40 100644 --- a/sql/statement.h +++ b/sql/statement.h @@ -58,7 +58,7 @@ class SQL_EXPORT Statement { // Returns true if the statement can be executed. All functions can still // be used if the statement is invalid, but they will return failure or some // default value. This is because the statement can become invalid in the - // middle of executing a command if there is a serioud error and the database + // middle of executing a command if there is a serious error and the database // has to be reset. bool is_valid() const { return ref_->is_valid(); } -- cgit v1.1