Index: jni/sqlite/Android.mk ================================================================== --- jni/sqlite/Android.mk +++ jni/sqlite/Android.mk @@ -2,10 +2,16 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) # If using SEE, uncomment the following: # LOCAL_CFLAGS += -DSQLITE_HAS_CODEC + +# This is important - it causes SQLite to use memory for temp files. Since +# Android has no globally writable temp directory, if this is not defined the +# application throws an exception when it tries to create a temp file. +# +LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=3 LOCAL_CFLAGS += -DHAVE_CONFIG_H -DKHTML_NO_EXCEPTIONS -DGKWQ_NO_JAVA LOCAL_CFLAGS += -DNO_SUPPORT_JS_BINDING -DQT_NO_WHEELEVENT -DKHTML_NO_XBL LOCAL_CFLAGS += -U__APPLE__ LOCAL_CFLAGS += -DHAVE_STRCHRNUL=0 Index: src/org/sqlite/app/customsqlite/CustomSqlite.java ================================================================== --- src/org/sqlite/app/customsqlite/CustomSqlite.java +++ src/org/sqlite/app/customsqlite/CustomSqlite.java @@ -240,10 +240,25 @@ db.close(); test_result("csr_test_1.2", db_is_encrypted(), "unencrypted"); } + + public void stmt_jrnl_test_1() throws Exception { + SQLiteDatabase.deleteDatabase(DB_PATH); + SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH, null); + String res = ""; + + db.execSQL("CREATE TABLE t1(x, y UNIQUE)"); + db.execSQL("BEGIN"); + db.execSQL("INSERT INTO t1 VALUES(1, 1), (2, 2), (3, 3)"); + db.execSQL("UPDATE t1 SET y=y+3"); + db.execSQL("COMMIT"); + db.close(); + test_result("stmt_jrnl_test_1.1", "did not crash", "did not crash"); + } + public String string_from_t1_x(SQLiteDatabase db){ String res = ""; Cursor c = db.rawQuery("SELECT x FROM t1", null); boolean bRes; @@ -344,11 +359,10 @@ test_result("see_test_2.4", res, ".x.y.z"); test_result("see_test_2.5", db_is_encrypted(), "encrypted"); } - public void run_the_tests(View view){ System.loadLibrary("sqliteX"); DB_PATH = getApplicationContext().getDatabasePath("test.db"); DB_PATH.mkdirs(); @@ -362,10 +376,11 @@ csr_test_2(); thread_test_1(); thread_test_2(); see_test_1(); see_test_2(); + stmt_jrnl_test_1(); myTV.append("\n" + myNErr + " errors from " + myNTest + " tests\n"); } catch(Exception e) { myTV.append("Exception: " + e.toString() + "\n"); myTV.append(android.util.Log.getStackTraceString(e) + "\n");