Skip to content

Commit

Permalink
[sql] Also call ShouldIgnoreSqliteError() in Release build.
Browse files Browse the repository at this point in the history
https://crrev.com/92a2ab1f1d0cdff39e6d506c4cb6a80038baeeb3 put the
test (which has a side effect) in DLOG_IF which doesn't apply in
Release builds.

BUG=none

Review URL: https://codereview.chromium.org/1075993003

Cr-Commit-Position: refs/heads/master@{#324697}
  • Loading branch information
dshess authored and Commit bot committed Apr 10, 2015
1 parent 3255651 commit 193bfb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sql/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,8 @@ scoped_refptr<Connection::StatementRef> Connection::GetUniqueStatement(
int rc = sqlite3_prepare_v2(db_, sql, -1, &stmt, NULL);
if (rc != SQLITE_OK) {
// This is evidence of a syntax error in the incoming SQL.
DLOG_IF(FATAL, !ShouldIgnoreSqliteError(rc))
<< "SQL compile error " << GetErrorMessage();
if (!ShouldIgnoreSqliteError(rc))
DLOG(FATAL) << "SQL compile error " << GetErrorMessage();

// It could also be database corruption.
OnSqliteError(rc, NULL, sql);
Expand All @@ -745,8 +745,8 @@ scoped_refptr<Connection::StatementRef> Connection::GetUntrackedStatement(
int rc = sqlite3_prepare_v2(db_, sql, -1, &stmt, NULL);
if (rc != SQLITE_OK) {
// This is evidence of a syntax error in the incoming SQL.
DLOG_IF(FATAL, !ShouldIgnoreSqliteError(rc))
<< "SQL compile error " << GetErrorMessage();
if (!ShouldIgnoreSqliteError(rc))
DLOG(FATAL) << "SQL compile error " << GetErrorMessage();
return new StatementRef(NULL, NULL, false);
}
return new StatementRef(NULL, stmt, true);
Expand Down

0 comments on commit 193bfb6

Please sign in to comment.