Use journal mode WAL only in R/W normal db 02/100902/2 accepted/tizen/3.0/common/20161130.133602 accepted/tizen/3.0/ivi/20161130.091219 accepted/tizen/3.0/mobile/20161130.091124 accepted/tizen/3.0/tv/20161130.091146 accepted/tizen/3.0/wearable/20161130.091203 submit/tizen_3.0/20161130.023420
authorJiwoong Im <jiwoong.im@samsung.com>
Tue, 29 Nov 2016 14:16:38 +0000 (23:16 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Wed, 30 Nov 2016 02:31:34 +0000 (11:31 +0900)
Change-Id: I4e0eb34e73f02b49c52695b81d465ec6ab02024b
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
backend/sqlite.c

index 13268ec..2f78e42 100644 (file)
@@ -87,14 +87,16 @@ static sqlite3 *open_sqlite3(const char *dbpath, bool readonly)
        }
 
        if (!db_exist) {
-               r = sqlite3_exec(db, "PRAGMA journal_mode = WAL",
-                               NULL, NULL, NULL);
-               if (r) {
-                       bxt_err("change journal mode '%s' failed: %s",
-                                       dbpath, sqlite3_errmsg(db));
-                       errno = EIO;
-                       free(nm);
-                       return NULL;
+               if (strncmp("/etc", dbpath, 4)) {
+                       r = sqlite3_exec(db, "PRAGMA journal_mode = WAL",
+                                       NULL, NULL, NULL);
+                       if (r) {
+                               bxt_err("change journal mode '%s' failed: %s",
+                                               dbpath, sqlite3_errmsg(db));
+                               errno = EIO;
+                               free(nm);
+                               return NULL;
+                       }
                }
 
                r = sqlite3_exec(db, QUERY_CREATE_TABLE_BUXTON,