Skip to content

fix: use UNION instead of UNION ALL #877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged

fix: use UNION instead of UNION ALL #877

merged 1 commit into from
Mar 20, 2025

Conversation

CyanVoxel
Copy link
Member

Summary

Replaces instances of UNION ALL with UNION to prevent infinite recursive loops in SQL statements. This also aligns with the intended behavior of these statements where the returned results should be unique (at least in library.py). Fixes #875.

From the SQLite docs:

If a UNION operator connects the initial-select with the recursive-select, then only add rows to the queue if no identical row has been previously added to the queue. Repeated rows are discarded before being added to the queue even if the repeated rows have already been extracted from the queue by the recursion step. If the operator is UNION ALL, then all rows generated by both the initial-select and the recursive-select are always added to the queue even if they are repeats. When determining if a row is repeated, NULL values compare equal to one another and not equal to any other value.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added Priority: Critical An issue that requires immediate attention TagStudio: Library Relating to the TagStudio library system TagStudio: Tags Relating to the TagStudio tag system Status: Review Needed A review of this is needed labels Mar 18, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5.2 milestone Mar 18, 2025
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Mar 18, 2025
@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Mar 20, 2025
@CyanVoxel CyanVoxel merged commit 5b5e878 into main Mar 20, 2025
10 checks passed
@CyanVoxel CyanVoxel deleted the fix-875 branch March 20, 2025 08:09
@github-project-automation github-project-automation bot moved this from 🏓 Ready for Review to ✅ Done in TagStudio Development Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Critical An issue that requires immediate attention TagStudio: Library Relating to the TagStudio library system TagStudio: Tags Relating to the TagStudio tag system
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[Bug]: Tags parented to each other causes TagStudio to freeze
1 participant