diff options
author | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-25 00:40:33 +0000 |
---|---|---|
committer | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-25 00:40:33 +0000 |
commit | 28fe0ffbf8c177f71381f83e281d4d0af0455f78 (patch) | |
tree | 2f0c21fe99657ce52f589ff971fb57572f64d6e8 /sql | |
parent | 11327b6f0e619f65f7f2196f24951a2420dd1945 (diff) | |
download | chromium_src-28fe0ffbf8c177f71381f83e281d4d0af0455f78.zip chromium_src-28fe0ffbf8c177f71381f83e281d4d0af0455f78.tar.gz chromium_src-28fe0ffbf8c177f71381f83e281d4d0af0455f78.tar.bz2 |
Remove operator overloads from Statement.
Fix leftover users of operators.
R=shess@chromium.org
BUG=None
TEST=sql_unittests,unit_tests
Review URL: http://codereview.chromium.org/9433022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql')
-rw-r--r-- | sql/connection.cc | 8 | ||||
-rw-r--r-- | sql/statement.h | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/sql/connection.cc b/sql/connection.cc index 58819a7..07e6af2 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -230,10 +230,11 @@ int Connection::ExecuteAndReturnErrorCode(const char* sql) { bool Connection::Execute(const char* sql) { int error = ExecuteAndReturnErrorCode(sql); - // TODO(shess,gbillock): DLOG(FATAL) once Execute() clients are - // converted. + // This needs to be a FATAL log because the error case of arriving here is + // that there's a malformed SQL statement. This can arise in development if + // a change alters the schema but not all queries adjust. if (error == SQLITE_ERROR) - DLOG(ERROR) << "SQL Error in " << sql << ", " << GetErrorMessage(); + DLOG(FATAL) << "SQL Error in " << sql << ", " << GetErrorMessage(); return error == SQLITE_OK; } @@ -310,6 +311,7 @@ bool Connection::DoesTableOrIndexExist( "WHERE type=? AND name=?")); statement.BindString(0, type); statement.BindString(1, name); + return statement.Step(); // Table exists if any row was returned. } diff --git a/sql/statement.h b/sql/statement.h index 5b4ff92..92d1ef2 100644 --- a/sql/statement.h +++ b/sql/statement.h @@ -66,12 +66,6 @@ class SQL_EXPORT Statement { // has to be reset. bool is_valid() const { return ref_->is_valid(); } - // These operators allow conveniently checking if the statement is valid - // or not. See the pattern above for an example. - // TODO(shess,gbillock): Remove these once clients are converted. - operator bool() const { return is_valid(); } - bool operator!() const { return !is_valid(); } - // Running ------------------------------------------------------------------- // Executes the statement, returning true on success. This is like Step but |