From b339509d3129db32a57ef95fc322a8482b6994f3 Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Thu, 10 Jun 2010 17:47:25 -0700 Subject: [PATCH] sqlite error "unsupported file format" = corruption sometimes sqlite corruption is so egregious that the sqlite doesn't even think the file is of supported formatl; ie., the file header is bad. treat this as corruption. this check used to be done in sqlite3.c - move it to android code so that we have less android-changes in sqlite3.c depends on Change-Id: I334286a1a377b962b1a97dd2af00e194f035090e Change-Id: Ide8cd1053b1ec00372fbc87caaaaefb408ce9104 --- core/jni/android_database_SQLiteDatabase.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp index 0c50c547c7a56..e4a050d06ffb9 100644 --- a/core/jni/android_database_SQLiteDatabase.cpp +++ b/core/jni/android_database_SQLiteDatabase.cpp @@ -531,6 +531,7 @@ void throw_sqlite3_exception(JNIEnv* env, int errcode, exceptionClass = "android/database/sqlite/SQLiteDiskIOException"; break; case SQLITE_CORRUPT: + case SQLITE_NOTADB: // treat "unsupported file format" error as corruption also exceptionClass = "android/database/sqlite/SQLiteDatabaseCorruptException"; break; case SQLITE_CONSTRAINT: