Fix get app control info query 92/197792/2
authorilho <ilho159.kim@samsung.com>
Wed, 16 Jan 2019 10:46:25 +0000 (19:46 +0900)
committerilho <ilho159.kim@samsung.com>
Thu, 17 Jan 2019 01:09:45 +0000 (10:09 +0900)
Change-Id: I2584f1719d2d333db30f8460230f72700fef5ac7
Signed-off-by: ilho <ilho159.kim@samsung.com>
src/pkgmgrinfo_appinfo.c

index 7d0f074..3ea034f 100644 (file)
@@ -198,9 +198,10 @@ static int _appinfo_get_app_control(sqlite3 *db, const char *appid,
                GList **appcontrol)
 {
        static const char query_raw[] =
-               "SELECT app_control, visibility FROM package_app_app_control "
-               "WHERE app_id=%Q";
+               "SELECT app_control, visibility, app_control_id "
+               "FROM package_app_app_control WHERE app_id=%Q";
        int ret;
+       int idx;
        char *query;
        sqlite3_stmt *stmt;
        char *str;
@@ -224,9 +225,10 @@ static int _appinfo_get_app_control(sqlite3 *db, const char *appid,
                str = NULL;
                visibility = NULL;
                id = NULL;
-               _save_column_str(stmt, 0, &str);
-               _save_column_str(stmt, 0, &visibility);
-               _save_column_str(stmt, 0, &id);
+               idx = 0;
+               _save_column_str(stmt, idx++, &str);
+               _save_column_str(stmt, idx++, &visibility);
+               _save_column_str(stmt, idx++, &id);
                /* TODO: revise */
                __parse_appcontrol(appcontrol, str, visibility, id);
                free(str);