[MDEV-794] LP:861763 - Inconsistent use of column alias In ORDER BY clause that specified collation Created: 2011-09-28 Updated: 2022-10-31 Resolved: 2022-10-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5.28 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Timour Katchaounov (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
This bug is created to track MySQL BUG#59449, and to review and |
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2011-10-05 ] |
|
Re: Inconsistent use of column alias In ORDER BY clause that specified collation CREATE TABLE Language ( INSERT INTO Language VALUES – works as expected - no collation - sorted by alias to a function result (alias has name matching a real field from a queried table) – broken - collated - sorted by alias to a function (coalesce) result (alias has name matching a real field from a queried table) – broken - collated - sorted by alias to a column (alias has name matching a real field from a queried table) drop table Language; |
| Comment by Timour Katchaounov (Inactive) [ 2011-10-05 ] |
|
Re: Inconsistent use of column alias In ORDER BY clause that specified collation Order by expressions are resolved by the procedure find_order_in_list(). /* Lookup the current GROUP/ORDER field in the SELECT clause. */ Note however that find_item_in_list() works only for fields (Item_field) Thus functions in the ORDER clause are not resolved against the For functions, fix_fields() calls recursively fix_fields() for its However Item_field::fix_fields() is designed to resolve fields This explains why the first example is resolved correctly, and the |
| Comment by Timour Katchaounov (Inactive) [ 2011-10-06 ] |
|
Re: Inconsistent use of column alias In ORDER BY clause that specified collation In summary, the problem that needs to be solved is that The implementation in find_order_in_list() is limited only As discussed with Sanja, the right way to have a flexible and Items have to be marked correctly with their location in the query. Notice that when e.g. an Item_field in an ORDER/GROUP BY clause This is a small re-engineering task, and not a simple bug fix. My estimate |
| Comment by Rasmus Johansson (Inactive) [ 2011-10-21 ] |
|
Launchpad bug id: 861763 |
| Comment by Sergei Golubchik [ 2022-10-31 ] |
|
fixed long time ago |