• gkodinov/kgeorge@macbook.gmz's avatar
    Bug #22457: Column alias in ORDER BY works, but not if in an expression · 77acba32
    gkodinov/kgeorge@macbook.gmz authored
     The parser is allocating Item_field for references by name in ORDER BY
     expressions. Such expressions however may point not only to Item_field 
     in the select list (or to a table column) but also to an arbitrary Item. 
     This causes Item_field::fix_fields to throw an error about missing 
     column.
     The fix substitutes Item_field for the reference with an Item_ref when 
     not pointing to Item_field.
    77acba32
order_by.test 20.7 KB