1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

bug#3681 - order by, distinct, refer to aliased field by name

check for field_name (not only for name) in find_item_in_list, to be compatible with item->eq() that is done later


mysql-test/r/order_by.result:
  bug#3681 - order by, distinct, refer to aliased field by name
This commit is contained in:
unknown
2004-05-17 11:04:12 +02:00
parent 36bce25112
commit 484f6cb3b4
2 changed files with 5 additions and 3 deletions

View File

@ -2103,7 +2103,9 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
=> we have to check presence of name before compare
*/
if (item_field->name &&
!my_strcasecmp(system_charset_info, item_field->name, field_name))
(!my_strcasecmp(system_charset_info, item_field->name, field_name) ||
!my_strcasecmp(system_charset_info,
item_field->field_name, field_name)))
{
if (!table_name)
{