Skip to content

[26.0] Fix CardinalityViolation in nested collection ARRAY walk scalar subqueries#22123

Merged
mvdbeek merged 1 commit intogalaxyproject:release_26.0from
mvdbeek:fix_cardinality_violation
Mar 15, 2026
Merged

[26.0] Fix CardinalityViolation in nested collection ARRAY walk scalar subqueries#22123
mvdbeek merged 1 commit intogalaxyproject:release_26.0from
mvdbeek:fix_cardinality_violation

Conversation

@mvdbeek
Copy link
Copy Markdown
Member

@mvdbeek mvdbeek commented Mar 14, 2026

Add .limit(1) to correlated scalar subqueries that navigate from leaf elements to ancestors via child_collection_id. When multiple parent DatasetCollectionElements reference the same child collection the subqueries returned more than one row, causing PostgreSQL to raise "more than one row returned by a subquery used as an expression".

Fixes #22122

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

…eries

Add .limit(1) to correlated scalar subqueries that navigate from leaf
elements to ancestors via child_collection_id.  When multiple parent
DatasetCollectionElements reference the same child collection the
subqueries returned more than one row, causing PostgreSQL to raise
"more than one row returned by a subquery used as an expression".

Fixes galaxyproject#22122
@github-actions github-actions Bot changed the title Fix CardinalityViolation in nested collection ARRAY walk scalar subqu… [26.0] Fix CardinalityViolation in nested collection ARRAY walk scalar subqu… Mar 14, 2026
@github-actions github-actions Bot added area/testing area/database Galaxy's database or data access layer labels Mar 14, 2026
@github-actions github-actions Bot added this to the 26.1 milestone Mar 14, 2026
@nsoranzo nsoranzo changed the title [26.0] Fix CardinalityViolation in nested collection ARRAY walk scalar subqu… [26.0] Fix CardinalityViolation in nested collection ARRAY walk scalar subqueries Mar 14, 2026
@mvdbeek mvdbeek merged commit bbe9d17 into galaxyproject:release_26.0 Mar 15, 2026
62 of 64 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in Galaxy Dev - weeklies Mar 15, 2026
@ahmedhamidawan ahmedhamidawan modified the milestones: 26.1, 26.0 Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/database Galaxy's database or data access layer area/testing kind/bug

Projects

Development

Successfully merging this pull request may close these issues.

4 participants