SQLite 突然认为一切都不是错误
SQLite suddenly considers everything as not an error
它从 Android phone 开始,在 assets/migrations 文件夹(我使用第 3 方名为 ActiveAndroid 的库在 2 年内运行良好 - 我对此没有进行任何更改):
CREATE TABLE IF NOT EXISTS Car (Brand TEXT);
我得到这个异常:
04-07 15:31:36.683 15738-15738/? E/SQLiteLog﹕ (21) API called with NULL prepared statement
04-07 15:31:36.683 15738-15738/? E/SQLiteLog﹕ (21) misuse at line 63243 of [00bb9c9ce4]
java.lang.RuntimeException: Unable to create application com.activeandroid.app.Application: android.database.sqlite.SQLiteException: not an error (code 0)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394)
at android.app.ActivityThread.access00(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: not an error (code 0)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:727)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1665)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1594)
at com.activeandroid.DatabaseHelper.executeSqlScript(DatabaseHelper.java:185)
at com.activeandroid.DatabaseHelper.executeMigrations(DatabaseHelper.java:155)
at com.activeandroid.DatabaseHelper.onUpgrade(DatabaseHelper.java:78)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:257)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
at com.activeandroid.Cache.openDatabase(Cache.java:104)
at com.activeandroid.Cache.initialize(Cache.java:77)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:43)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:30)
at com.activeandroid.app.Application.onCreate(Application.java:25)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
at android.app.ActivityThread.access00(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
所以我在我的计算机上使用名为 SQLite Manager 的 Firefox 插件检查了它并创建了一个全新的文件(该文件与 Android 数据库完全无关)。
我使用了这个 select 并且在最后一个错误中我得到了这个:
似乎每个 SQLite 语句都是 不是错误 语句。
不幸的是,Android 无法处理。
我该怎么办?
似乎 assets\migration 文件夹 中的 升级脚本有一些 空行 并且导致了 不是错误。
它从 Android phone 开始,在 assets/migrations 文件夹(我使用第 3 方名为 ActiveAndroid 的库在 2 年内运行良好 - 我对此没有进行任何更改):
CREATE TABLE IF NOT EXISTS Car (Brand TEXT);
我得到这个异常:
04-07 15:31:36.683 15738-15738/? E/SQLiteLog﹕ (21) API called with NULL prepared statement
04-07 15:31:36.683 15738-15738/? E/SQLiteLog﹕ (21) misuse at line 63243 of [00bb9c9ce4]
java.lang.RuntimeException: Unable to create application com.activeandroid.app.Application: android.database.sqlite.SQLiteException: not an error (code 0)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394)
at android.app.ActivityThread.access00(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: not an error (code 0)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:727)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1665)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1594)
at com.activeandroid.DatabaseHelper.executeSqlScript(DatabaseHelper.java:185)
at com.activeandroid.DatabaseHelper.executeMigrations(DatabaseHelper.java:155)
at com.activeandroid.DatabaseHelper.onUpgrade(DatabaseHelper.java:78)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:257)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
at com.activeandroid.Cache.openDatabase(Cache.java:104)
at com.activeandroid.Cache.initialize(Cache.java:77)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:43)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:30)
at com.activeandroid.app.Application.onCreate(Application.java:25)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
at android.app.ActivityThread.access00(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
所以我在我的计算机上使用名为 SQLite Manager 的 Firefox 插件检查了它并创建了一个全新的文件(该文件与 Android 数据库完全无关)。 我使用了这个 select 并且在最后一个错误中我得到了这个:
似乎每个 SQLite 语句都是 不是错误 语句。
不幸的是,Android 无法处理。
我该怎么办?
似乎 assets\migration 文件夹 中的 升级脚本有一些 空行 并且导致了 不是错误。