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
This commit is contained in:
Jeff Brown
2012-03-05 10:30:06 -08:00
parent 8dc3cc2e13
commit 08cbdad565

View File

@@ -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);
}