From 08cbdad565b3d2a01b005ceea5667f261ba89353 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Mon, 5 Mar 2012 10:30:06 -0800 Subject: [PATCH] Don't log SQLITE_SCHEMA errors. These errors are usually transient. SQLite automatically retries queries up to 5 times before actually reporting an error to the application. We expect SQLITE_SCHEMA errors to occur occasionally due to the prepared statement cache, and it is ok. If SQLite fails to automatically resolve a schema error, then a SQLiteException will be thrown as usual. Bug: 6114391 Change-Id: I0cdafa1a1db5c567b95bec0c41310802fe75a8c7 --- core/jni/android_database_SQLiteGlobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_database_SQLiteGlobal.cpp b/core/jni/android_database_SQLiteGlobal.cpp index 9301183da8634..acc2276ef9d16 100644 --- a/core/jni/android_database_SQLiteGlobal.cpp +++ b/core/jni/android_database_SQLiteGlobal.cpp @@ -37,7 +37,7 @@ static const int SOFT_HEAP_LIMIT = 8 * 1024 * 1024; // Called each time a message is logged. static void sqliteLogCallback(void* data, int iErrCode, const char* zMsg) { bool verboseLog = !!data; - if (iErrCode == 0 || iErrCode == SQLITE_CONSTRAINT) { + if (iErrCode == 0 || iErrCode == SQLITE_CONSTRAINT || iErrCode == SQLITE_SCHEMA) { if (verboseLog) { ALOGV(LOG_VERBOSE, SQLITE_LOG_TAG, "(%d) %s\n", iErrCode, zMsg); }