parameter binding will not work when filter is null 03/72403/2 accepted/tizen/common/20160602.140041 accepted/tizen/ivi/20160602.022846 accepted/tizen/mobile/20160602.023019 accepted/tizen/tv/20160602.022547 accepted/tizen/wearable/20160602.022733 submit/tizen/20160531.024853
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 1 Jun 2016 00:03:11 +0000 (09:03 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 1 Jun 2016 00:15:12 +0000 (09:15 +0900)
When there are no parameters to binded,
Binding parameter will not work

Change-Id: Ie05e3d20fb3ec70220ecf0ca032d313bbd921404
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkgmgrinfo_appinfo.c

index 7bf75ec..848896e 100644 (file)
@@ -595,10 +595,12 @@ static int _appinfo_get_applications(uid_t db_uid, uid_t uid,
                goto catch;
        }
 
-       ret = __bind_params(stmt, bind_params);
-       if (ret != SQLITE_OK) {
-               LOGE("Failed to bind parameters");
-               goto catch;
+       if (g_list_length(bind_params) != 0) {
+               ret = __bind_params(stmt, bind_params);
+               if (ret != SQLITE_OK) {
+                       LOGE("Failed to bind parameters");
+                       goto catch;
+               }
        }
 
        while (sqlite3_step(stmt) == SQLITE_ROW) {