Skip to content

fix: calc element with exists through association#1608

Merged
patricebender merged 4 commits into
mainfrom
fix/calc-element-exists-through-assoc
May 15, 2026
Merged

fix: calc element with exists through association#1608
patricebender merged 4 commits into
mainfrom
fix/calc-element-exists-through-assoc

Conversation

@patricebender
Copy link
Copy Markdown
Member

@patricebender patricebender commented May 11, 2026

When a calculated element containing exists <assoc>[filter] is accessed through another association (e.g. project.isUserNotMember), the join tree must include a JOIN for the preceding association so the exists subquery can correlate against it.

  • mergePathsIntoJoinTree: detect exists in xpr and merge only the prefix path as a JOIN, not the exists-target association itself

…ntext

When a calculated element containing `exists <assoc>[filter]` is accessed
through another association (e.g. `project.isUserNotMember`), the join
tree must include a JOIN for the preceding association so the exists
subquery can correlate against it.

Two fixes in infer/index.js:
- mergePathsIntoJoinTree: detect `exists` in xpr and merge only the
  prefix path as a JOIN, not the exists-target association itself
- isColumnJoinRelevant: when a managed association was already traversed,
  encountering an unmanaged association must return true
@patricebender patricebender marked this pull request as ready for review May 12, 2026 09:39
@patricebender patricebender changed the title fix: calc element with exists through association in draft context fix: calc element with exists through association May 12, 2026
@patricebender patricebender merged commit 0d24b28 into main May 15, 2026
5 checks passed
@patricebender patricebender deleted the fix/calc-element-exists-through-assoc branch May 15, 2026 10:46
@github-actions github-actions Bot mentioned this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants