]> git.ktnx.net Git - mobile-ledger.git/commitdiff
turn on case-sensitive LIKE operator, globally
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 14 Mar 2019 21:27:00 +0000 (23:27 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 15 Mar 2019 02:57:42 +0000 (04:57 +0200)
app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java

index 7da81f979063e0f9c458a07b4d9ca8604ac9c5c4..2fb94e085fb8146aa9be71899f50587635be68d7 100644 (file)
@@ -64,14 +64,19 @@ public final class MLDB {
     public static synchronized SQLiteDatabase getDatabase(DatabaseMode mode) {
         checkState();
 
+        SQLiteDatabase db;
+
         if (mode == READ) {
             if (helperForReading == null) helperForReading = new MobileLedgerDatabase(context);
-            return helperForReading.getReadableDatabase();
+            db = helperForReading.getReadableDatabase();
         }
         else {
             if (helperForWriting == null) helperForWriting = new MobileLedgerDatabase(context);
-            return helperForWriting.getWritableDatabase();
+            db = helperForWriting.getWritableDatabase();
         }
+
+        db.execSQL("pragma case_sensitive_like=ON;");
+        return db;
     }
     public static SQLiteDatabase getReadableDatabase() {
         return getDatabase(READ);