Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5058)

Unified Diff: chrome/common/sqlite_utils.cc

Issue 195020: Crash on serious error in sqlite (release build)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/sqlite_utils.cc
===================================================================
--- chrome/common/sqlite_utils.cc (revision 25038)
+++ chrome/common/sqlite_utils.cc (working copy)
@@ -42,8 +42,14 @@
public:
virtual int HandleError(int error, sqlite3* db) {
error_ = error;
- // TODO(cpu): need to write to some place so we can trigger
- // the diagnostic-repair mode.
+ // TOD(cpu): Remove this code once it has a few days of air time.
+ if (error == SQLITE_INTERNAL ||
+ error == SQLITE_NOMEM ||
+ error == SQLITE_CORRUPT ||
+ error == SQLITE_IOERR ||
+ error == SQLITE_CONSTRAINT ||
+ error == SQLITE_NOTADB)
+ CHECK(false) << "sqlite fatal error " << error;
return error;
}
};
@@ -277,7 +283,8 @@
DCHECK(!stmt_);
int rv = sqlite3_prepare_v2(db, sql, sql_len, &stmt_, NULL);
if (rv != SQLITE_OK) {
- DLOG(ERROR) << "SQLStatement.prepare_v2 failed: " << sqlite3_errmsg(db);
+ SQLErrorHandler* error_handler = GetErrorHandlerFactory()->Make();
+ return error_handler->HandleError(rv, db_handle());
}
return rv;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698