-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
MySQL Bugs: #103609 Unknown column 'upper.j' in 'field list' #24444
Comments
The root cause of the problem is that, in It is pretty difficult / tricky to fix this problem, we have to write an ad-hoc logic to flatten the subquery containing correlated columns into a simple column list, i.e, expression rewriter should convert the subquery Currently we have only 2 possible actions for a scalar subquery: building an apply if the subquery contains correlated columns, or executing it directly if it is an uncorrelated subquery, both of them are not suitable for our case. A tricky solution would be that, we hack This approach should be able to solve the problem, but it is too tricky and would make the code messy and complicated. Considered that we have an equivalent, simpler and more reasonable rewriting for the query, i.e, |
I think "support correlated columns as the window function arguments" should be a more proper title for this issue. |
Credit to @time-and-fate for reminding that
is wrong, we can actually build the window function on top of the apply after appending |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
MySQL 8.0.21
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: