media_svc_retvm_if(album == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "album is NULL");
- if (artist != NULL)
- sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name = '%q' AND artist = '%q';", DB_TABLE_ALBUM, album, artist);
+ if (artist)
+ sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name=%Q AND artist=%Q", DB_TABLE_ALBUM, album, artist);
else
- sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name = '%q' AND artist IS NULL;", DB_TABLE_ALBUM, album);
+ sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name=%Q AND artist IS NULL", DB_TABLE_ALBUM, album);
ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
{
int ret = MS_MEDIA_ERR_NONE;
- char *sql = sqlite3_mprintf("INSERT INTO %s (name, artist, album_art) values (%Q, %Q, %Q);", DB_TABLE_ALBUM, album, artist, album_art);
+ char *sql = sqlite3_mprintf("INSERT INTO %s(name, artist, album_art) VALUES (%Q, %Q, %Q);", DB_TABLE_ALBUM, album, artist, album_art);
if (is_direct)
ret = _media_svc_sql_query_direct(sql, uid);
else