bugfix: Columns alias expanding#14935
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #14935 +/- ##
==========================================
- Coverage 47.29% 47.25% -0.05%
==========================================
Files 1137 1137
Lines 238684 238681 -3
==========================================
- Hits 112895 112781 -114
- Misses 117168 117304 +136
+ Partials 8621 8596 -25 ☔ View full report in Codecov by Sentry. |
|
The codecov report doesn't seem to take into account the unit tests we have in the |
harshit-gangal
left a comment
There was a problem hiding this comment.
what is the expectation where order by and group by has alias referencing to a subquery
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
me and @harshit-gangal looked at this, and it's a real issue, but unrelated to these changes. I'll work on fixing this separately: #14950 does not need to block this PR |
We should look into that @mattlord. I can see the base branch reports |
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
Description
We were not rewriting column aliases correctly. The rules that MySQL 8.0.x follows are not well documented, and in some cases we have found that the manual is not agreeing with our experiments.
This PR changes the alias rewriting rules to make sure to rewrite aliases early in the planning process, and removes the complex column lookup logic, which is no longer needed.
Related Issue(s)
Fixes #14869
Checklist