diff --git a/src/tagstudio/core/library/alchemy/library.py b/src/tagstudio/core/library/alchemy/library.py index bb9326854..81e259d44 100644 --- a/src/tagstudio/core/library/alchemy/library.py +++ b/src/tagstudio/core/library/alchemy/library.py @@ -96,7 +96,7 @@ -- Note for this entire query that tag_parents.child_id is the parent id and tag_parents.parent_id is the child id due to bad naming WITH RECURSIVE ChildTags AS ( SELECT :tag_id AS child_id - UNION ALL + UNION SELECT tp.parent_id AS child_id FROM tag_parents tp INNER JOIN ChildTags c ON tp.child_id = c.child_id diff --git a/src/tagstudio/core/library/alchemy/visitors.py b/src/tagstudio/core/library/alchemy/visitors.py index e242d2f69..31a10d76b 100644 --- a/src/tagstudio/core/library/alchemy/visitors.py +++ b/src/tagstudio/core/library/alchemy/visitors.py @@ -36,7 +36,7 @@ -- Note for this entire query that tag_parents.child_id is the parent id and tag_parents.parent_id is the child id due to bad naming WITH RECURSIVE ChildTags AS ( SELECT :tag_id AS child_id - UNION ALL + UNION SELECT tp.parent_id AS child_id FROM tag_parents tp INNER JOIN ChildTags c ON tp.child_id = c.child_id