From: Damyan Ivanov Date: Thu, 14 Mar 2019 21:27:00 +0000 (+0200) Subject: turn on case-sensitive LIKE operator, globally X-Git-Tag: v0.8~9 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=4b1ce9a009a8cc82cb10ab95d629b0ce79e0af31;p=mobile-ledger.git turn on case-sensitive LIKE operator, globally --- diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java index 7da81f97..2fb94e08 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java @@ -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);