summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 17:49:00 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 17:49:00 +0000
commit0ea28372bf531547a1db8e474bdcd776272e981f (patch)
tree3f00c4c358c77c822a9e04816c17102423a2a2d7 /chrome
parent9b1711a8fc2b06a63387cc97bd590fcb13616369 (diff)
downloadchromium_src-0ea28372bf531547a1db8e474bdcd776272e981f.zip
chromium_src-0ea28372bf531547a1db8e474bdcd776272e981f.tar.gz
chromium_src-0ea28372bf531547a1db8e474bdcd776272e981f.tar.bz2
Crash on serious error in sqlite (release build)
How do you guys feel about trying this pach for a few days? The idea is to have devs that run their own build to help us test wether or not we are having serious errors. I'll monitor the crash server to see if we get crashes here BUG=11908 TEST=none Review URL: http://codereview.chromium.org/195020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25633 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/sqlite_utils.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/common/sqlite_utils.cc b/chrome/common/sqlite_utils.cc
index c37ba9b..61b476b 100644
--- a/chrome/common/sqlite_utils.cc
+++ b/chrome/common/sqlite_utils.cc
@@ -42,8 +42,14 @@ class ReleaseSQLErrorHandler : public VanillaSQLErrorHandler {
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 @@ int SQLStatement::prepare(sqlite3* db, const char* sql, int sql_len) {
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;
}