diff options
author | unknown <igor@olga.mysql.com> | 2007-01-10 00:27:11 -0800 |
---|---|---|
committer | unknown <igor@olga.mysql.com> | 2007-01-10 00:27:11 -0800 |
commit | 6fc17dab1ec371ca2849a6df8661b5420d1cb255 (patch) | |
tree | ce7c35c4bbf327fcd8e1c81681d199433b1eec9f /sql/item.cc | |
parent | 8e0eea0d336fe259a753ebc380bc85cf31b29599 (diff) | |
download | mariadb-git-6fc17dab1ec371ca2849a6df8661b5420d1cb255.tar.gz |
Fixed bug #25427.
In the method Item_field::fix_fields we try to resolve the name of
the field against the names of the aliases that occur in the select
list. This is done by a call of the function find_item_in_list.
When this function finds several occurrences of the field name
it sends an error message to the error queue and returns 0.
Yet the code did not take into account that find_item_in_list
could return 0 and tried to dereference the returned value.
mysql-test/r/order_by.result:
Added a test case for bug #25427.
mysql-test/t/order_by.test:
Added a test case for bug #25427.
sql/item.cc:
Fixed bug #25427.
In the method Item_field::fix_fields we try to resolve the name of
the field against the names of the aliases that occur in the select
list. This is done by a call of the function find_item_in_list.
When this function finds several occurrences of the field name
it sends an error message to the error queue and returns 0.
Yet the code did not take into account that find_item_in_list
could return 0 and tried to dereference the returned value.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 45d7856b2c1..1e8c70c6616 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1761,6 +1761,8 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) Item** res= find_item_in_list(this, thd->lex->current_select->item_list, &counter, REPORT_EXCEPT_NOT_FOUND, ¬_used); + if (!res) + return 1; if (res != (Item **)not_found_item) { if ((*res)->type() == Item::FIELD_ITEM) |