Skip to content

Fix single-row subquery optimization once again#3288

Merged
katzyn merged 1 commit into
h2database:masterfrom
katzyn:subquery
Dec 21, 2021
Merged

Fix single-row subquery optimization once again#3288
katzyn merged 1 commit into
h2database:masterfrom
katzyn:subquery

Conversation

@katzyn

@katzyn katzyn commented Dec 21, 2021

Copy link
Copy Markdown
Contributor

Complex single-row subqueries may have columns from both inner and outer column resolvers. When subquery is converted into plain expression we need to decrement query level only in columns from outer column resolvers.

Closes #3287.

I also added a setting for this optimization (;OPTIMIZE_SIMPLE_SINGLE_ROW_SUBQUERIES=FALSE), it can be used if something else is still wrong.

@katzyn katzyn merged commit d3a0679 into h2database:master Dec 21, 2021
@katzyn katzyn deleted the subquery branch December 21, 2021 04:34
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.

SELECT statement works on 1.4.200 but fails on 2.0.202 with "Column XYZ must be in the GROUP BY list"

1 participant