diff --git a/src/common/tags.c b/src/common/tags.c index afe1352332e0..a7d4c3300b74 100644 --- a/src/common/tags.c +++ b/src/common/tags.c @@ -1171,7 +1171,7 @@ uint32_t dt_tag_get_suggestions(GList **result) " LEFT JOIN (" " SELECT tagid, COUNT(imgid) AS count2" " FROM main.tagged_images" - " WHERE imgid IN main.selected_images" + " WHERE imgid IN (SELECT imgid FROM main.selected_images)" " GROUP BY tagid) AS at" " ON at.tagid = S.tagid" " WHERE S.tagid NOT IN memory.darktable_tags" diff --git a/src/dtgtk/thumbnail.c b/src/dtgtk/thumbnail.c index 2748a442dde5..ab55950e6848 100644 --- a/src/dtgtk/thumbnail.c +++ b/src/dtgtk/thumbnail.c @@ -1046,7 +1046,7 @@ static gboolean _event_grouping_release(GtkWidget *widget, sqlite3_stmt *stmt; DT_DEBUG_SQLITE3_PREPARE_V2( dt_database_get(darktable.db), - "INSERT OR IGNORE INTO main.selected_images" + "INSERT OR IGNORE INTO main.selected_images (imgid)" " SELECT id FROM main.images WHERE group_id = ?1", -1, &stmt, NULL); DT_DEBUG_SQLITE3_BIND_INT(stmt, 1, thumb->groupid);