SQLite Android Bindings
Check-in [57831c6020]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add -DSQLITE_TEMP_STORE=3 to the SQLite compilation flags.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 57831c602023d775ac6bf96e1049eb755d4fe03a
User & Date: dan 2014-11-05 19:17:57
Context
2014-12-04
16:49
Add the requirement to call 'System.loadLibrary("sqliteX");' to the docs. check-in: 89b2225ad2 user: dan tags: trunk
2014-11-05
19:19
Merge latest fixes with this branch. check-in: 60e268f5be user: dan tags: api-level-15
19:17
Add -DSQLITE_TEMP_STORE=3 to the SQLite compilation flags. check-in: 57831c6020 user: dan tags: trunk
2014-10-16
20:06
Update to 3.8.7. Add -DHAVE_STRCHRNUL to Android.mk file. check-in: f9a25feeb0 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to jni/sqlite/Android.mk.

     1      1   
     2      2   LOCAL_PATH:= $(call my-dir)
     3      3   include $(CLEAR_VARS)
     4      4   
     5      5   # If using SEE, uncomment the following:
     6      6   # LOCAL_CFLAGS += -DSQLITE_HAS_CODEC
            7  +
            8  +# This is important - it causes SQLite to use memory for temp files. Since 
            9  +# Android has no globally writable temp directory, if this is not defined the
           10  +# application throws an exception when it tries to create a temp file.
           11  +#
           12  +LOCAL_CFLAGS += -DSQLITE_TEMP_STORE=3
     7     13   
     8     14   LOCAL_CFLAGS += -DHAVE_CONFIG_H -DKHTML_NO_EXCEPTIONS -DGKWQ_NO_JAVA
     9     15   LOCAL_CFLAGS += -DNO_SUPPORT_JS_BINDING -DQT_NO_WHEELEVENT -DKHTML_NO_XBL
    10     16   LOCAL_CFLAGS += -U__APPLE__
    11     17   LOCAL_CFLAGS += -DHAVE_STRCHRNUL=0
    12     18   LOCAL_CFLAGS += -Wno-unused-parameter -Wno-int-to-pointer-cast
    13     19   LOCAL_CFLAGS += -Wno-maybe-uninitialized -Wno-parentheses

Changes to src/org/sqlite/app/customsqlite/CustomSqlite.java.

   238    238       }
   239    239       test_result("csr_test_1.1", res, ".one.two.three");
   240    240   
   241    241       db.close();
   242    242       test_result("csr_test_1.2", db_is_encrypted(), "unencrypted");
   243    243     }
   244    244   
          245  +
          246  +  public void stmt_jrnl_test_1() throws Exception {
          247  +    SQLiteDatabase.deleteDatabase(DB_PATH);
          248  +    SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH, null);
          249  +    String res = "";
          250  +
          251  +    db.execSQL("CREATE TABLE t1(x, y UNIQUE)");
          252  +    db.execSQL("BEGIN");
          253  +      db.execSQL("INSERT INTO t1 VALUES(1, 1), (2, 2), (3, 3)");
          254  +      db.execSQL("UPDATE t1 SET y=y+3");
          255  +    db.execSQL("COMMIT");
          256  +    db.close();
          257  +    test_result("stmt_jrnl_test_1.1", "did not crash", "did not crash");
          258  +  }
          259  +
   245    260     public String string_from_t1_x(SQLiteDatabase db){
   246    261       String res = "";
   247    262   
   248    263       Cursor c = db.rawQuery("SELECT x FROM t1", null);
   249    264       boolean bRes;
   250    265       for(bRes=c.moveToFirst(); bRes; bRes=c.moveToNext()){
   251    266         String x = c.getString(0);
................................................................................
   342    357   
   343    358       db = helper.getWritableDatabase();
   344    359       test_result("see_test_2.4", res, ".x.y.z");
   345    360   
   346    361       test_result("see_test_2.5", db_is_encrypted(), "encrypted");
   347    362     }
   348    363   
   349         -
   350    364     public void run_the_tests(View view){
   351    365       System.loadLibrary("sqliteX");
   352    366       DB_PATH = getApplicationContext().getDatabasePath("test.db");
   353    367       DB_PATH.mkdirs();
   354    368   
   355    369       myTV.setText("");
   356    370       myNErr = 0;
................................................................................
   360    374         report_version();
   361    375         csr_test_1();
   362    376         csr_test_2();
   363    377         thread_test_1();
   364    378         thread_test_2(); 
   365    379         see_test_1();
   366    380         see_test_2();
          381  +      stmt_jrnl_test_1();
   367    382   
   368    383         myTV.append("\n" + myNErr + " errors from " + myNTest + " tests\n");
   369    384       } catch(Exception e) {
   370    385         myTV.append("Exception: " + e.toString() + "\n");
   371    386         myTV.append(android.util.Log.getStackTraceString(e) + "\n");
   372    387       }
   373    388     }
   374    389   }
   375    390   
   376    391