diff options
author | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 19:25:51 +0000 |
---|---|---|
committer | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 19:25:51 +0000 |
commit | bed29d94d90663ab161e5832677dae9dd4d4be13 (patch) | |
tree | 0527ff3b39d74e69ac5c030fbb6ade0fad803e20 /sql | |
parent | 443853c674eeabd922bfcda2caf0411f47c9a93c (diff) | |
download | chromium_src-bed29d94d90663ab161e5832677dae9dd4d4be13.zip chromium_src-bed29d94d90663ab161e5832677dae9dd4d4be13.tar.gz chromium_src-bed29d94d90663ab161e5832677dae9dd4d4be13.tar.bz2 |
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
Diffstat (limited to 'sql')
-rw-r--r-- | sql/statement.cc | 5 | ||||
-rw-r--r-- | sql/statement.h | 2 |
2 files changed, 6 insertions, 1 deletions
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(); } |