Add code for the DB recovery 95/230995/1
authorInHong Han <inhong1.han@samsung.com>
Thu, 16 Apr 2020 11:03:36 +0000 (20:03 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 16 Apr 2020 11:18:33 +0000 (20:18 +0900)
Change-Id: Iea229d68322b3c45affbaadea9aa556db4e9a6cc

server/stickerd_db_manager.c

index ad78560..6e3ace3 100644 (file)
@@ -318,6 +318,9 @@ static sqlite3 *_db_open(void)
     sqlite3 *db = NULL;
     char *err = NULL;
 
+    if (is_corrupted && _recover_db() != SQLITE_OK)
+        return NULL;
+
     ret = sqlite3_open(STICKER_DB_PATH, &db);
     if (ret != SQLITE_OK) {
         LOGE("Failed to open db : %s", sqlite3_errmsg(db));