Skip to content
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

RenderTable.WHEN_MULTIPLE_TABLES doesn't work correctly in correlated subqueries #15996

Closed
lukaseder opened this issue Dec 27, 2023 · 1 comment

Comments

@lukaseder
Copy link
Member

lukaseder commented Dec 27, 2023

The RenderTable.WHEN_MULTIPLE_TABLE flag introduced with #8893 (probably) doesn't work correctly in correlated subqueries, where we must disambiguate between tables from the local scope and tables from the outer scope. This affects both:

  • Normal correlated subqueries
  • Implicit path correlations

A prudent approach would be to always qualify fields with their tables in all scalar subqueries. Derived tables aren't affected, except for lateral derived tables, which are also correlated.

This likely also affects WHEN_AMBIGUOUS_COLUMNS.


See also:

@lukaseder
Copy link
Member Author

3.20 Other improvements automation moved this from To do to Done Jan 22, 2024
lukaseder added a commit that referenced this issue Jan 22, 2024
This includes:

- [#16121] Add Context.scopeParts(Class<Q>): Iterable<Q> to
allow for iterating over the values that are currently in scope
- [#15998] RenderTable.WHEN_AMBIGUOUS_COLUMNS doesn't cover all
ambiguous column name cases
- [#15996] RenderTable.WHEN_MULTIPLE_TABLES doesn't work
correctly in correlated subqueries
lukaseder added a commit that referenced this issue Jan 22, 2024
This includes:

- [#16121] Add Context.scopeParts(Class<Q>): Iterable<Q> to
allow for iterating over the values that are currently in scope
- [#15998] RenderTable.WHEN_AMBIGUOUS_COLUMNS doesn't cover all
ambiguous column name cases
- [#15996] RenderTable.WHEN_MULTIPLE_TABLES doesn't work
correctly in correlated subqueries
lukaseder added a commit that referenced this issue Jan 22, 2024
This includes:

- [#16121] Add Context.scopeParts(Class<Q>): Iterable<Q> to
allow for iterating over the values that are currently in scope
- [#15998] RenderTable.WHEN_AMBIGUOUS_COLUMNS doesn't cover all
ambiguous column name cases
- [#15996] RenderTable.WHEN_MULTIPLE_TABLES doesn't work
correctly in correlated subqueries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant