{
table_info_s *tbl = NULL;
- if (!MS_STRING_VALID(name))
+ if (!name)
return;
- if (MS_STRING_VALID(trigger_name)) {
- if(!MS_STRING_VALID(event_table) || !MS_STRING_VALID(action_table))
+ if (trigger_name) {
+ if(!event_table || !action_table)
return;
}
tbl = g_new0(table_info_s, 1);
- if (MS_STRING_VALID(trigger_name)) {
+ if (trigger_name) {
tbl->trigger_name = g_strdup(trigger_name);
tbl->event_table = g_strdup(event_table);
tbl->action_table = g_strdup(action_table);
}
- if (MS_STRING_VALID(view_name))
+ if (view_name)
tbl->view_name = g_strdup(view_name);
g_hash_table_insert(table, (gpointer)name, (gpointer)tbl);
/*create trigger */
if (col_ptr->is_trigger) {
- if (MS_STRING_VALID(tb->trigger_name)) {
+ if (tb->trigger_name) {
if (strncmp(table_name, DB_TABLE_ALBUM, strlen(DB_TABLE_ALBUM)) == 0) {
g_string_append_printf(trigger_query, DB_QUERY_TRIGGER_WITH_COUNT,
tb->trigger_name, tb->event_table, tb->action_table, tb->event_table,
media_svc_sec_debug("Query[%s]", sql_str);
- if (!MS_STRING_VALID(sql_str)) {
+ if (!STRING_VALID(sql_str)) {
media_svc_error("invalid query");
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
for (idx = 0; idx < length; idx++) {
sql = (char *)g_list_nth_data(*query_list, idx);
- if (MS_STRING_VALID(sql)) {
+ if (STRING_VALID(sql)) {
query_len = strlen(sql);
if (query_len >= (sizeof(query_bundle) - 1)) {
/* column limit = 2000 */
}
- SAFE_STRLCAT(query_bundle, sql, sizeof(query_bundle));
+ g_strlcat(query_bundle, sql, sizeof(query_bundle));
total_len += query_len;
SQLITE3_SAFE_FREE(sql);
for (idx = 0; idx < length; idx++) {
sql = (char *)g_list_nth_data(*query_list, idx);
- if (MS_STRING_VALID(sql)) {
+ if (STRING_VALID(sql)) {
ret = __media_svc_query_direct(handle, sql, uid);
if (ret != MS_MEDIA_ERR_NONE)
media_svc_debug("_media_svc_query_direct failed[%s]", sql);