char* condition = nullptr;
char buf[MAX_QUERY_LEN] = {'\0'};
char tmp_query[MAX_QUERY_LEN] = {'\0'};
+ GList* tmp_params = NULL;
GSList* list;
if (!filter)
for (list = filter->list; list; list = list->next) {
joined |= __get_filter_condition(list->data,
- uid, &condition, bind_params);
+ uid, &condition, &tmp_params);
if (condition == nullptr)
continue;
strncat(buf, " AND (", sizeof(buf) - strlen(buf) - 1);
for (list = filter->list_metadata; list; list = list->next) {
joined |= __get_metadata_filter_condition(list->data,
- &condition, bind_params);
+ &condition, &tmp_params);
if (condition == nullptr)
continue;
strncat(buf, condition, sizeof(buf) - strlen(buf) - 1);
strncat(tmp_query, join_privilege,
sizeof(tmp_query) - strlen(tmp_query) - 1);
+ *bind_params = g_list_concat(*bind_params, tmp_params);
size = strlen(tmp_query) + strlen(buf) + 1;
*query = static_cast<char*>(calloc(1, size));
if (*query == nullptr)
char buf[MAX_QUERY_LEN] = { '\0' };
char buf2[MAX_QUERY_LEN] = { '\0' };
char *condition = NULL;
+ GList *tmp_params = NULL;
GSList *list = NULL;
if (!filter)
snprintf(buf, sizeof(buf), "%s", " WHERE 1=1 ");
for (list = filter->list; list; list = list->next) {
joined |= __get_filter_condition(list->data, uid, &condition,
- bind_params);
+ &tmp_params);
if (condition == NULL)
continue;
strncat(buf2, join_res_info,
sizeof(buf2) - strlen(buf2) - 1);
+ *bind_params = g_list_concat(*bind_params, tmp_params);
size = strlen(buf2) + strlen(buf) + 1;
*query = (char *)calloc(1, size);
if (*query == NULL)