Skip to content

Fix correlated subqueries in grouped selects#2514

Open
pratyushsinghal7 wants to merge 1 commit into
AlaSQL:developfrom
pratyushsinghal7:issue-1106
Open

Fix correlated subqueries in grouped selects#2514
pratyushsinghal7 wants to merge 1 commit into
AlaSQL:developfrom
pratyushsinghal7:issue-1106

Conversation

@pratyushsinghal7

Copy link
Copy Markdown

Fixes #1106

Summary

  • retain the first source-row scope for each group so correlated scalar subqueries can resolve outer table aliases
  • resolve plain selected columns from that source row while keeping aggregate and grouped expressions on group state
  • avoid overwriting non-grouped columns with missing group values
  • add regression coverage for the reported grouped correlated subquery

Testing

  • bun test --preload ./test/bun-setup.js ./test/test1106.js ./test/test1967.js ./test/test941.js ./test/test416.js (25 passed, 1 skipped)
  • full suite: 2189 passed, 213 skipped, 0 failed
  • prettier --check src/40select.js src/423groupby.js src/424select.js test/test1106.js
  • git diff --check

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.

Can't reference table name in subquery if grouped

1 participant