summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2015-04-15 16:23:43 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2015-04-15 16:23:43 +0300
commiteb47b226d268e7820a9153672798cf991a8fd0fa (patch)
tree2615389fed672ebf06a32a2bb2c373b782636be8 /sql
parentcc84ac3be41d9d6ac480d55449d5bf4e324cca10 (diff)
downloadmariadb-git-5.5-MDEV-7820.tar.gz
MDEV-7820 Server crashes in in my_strcasecmp_utf8 on subquery in ORDER BY clause of GROUP_CONCAT5.5-MDEV-7820
It is possible for Item_field to have a NULL field_name. This is true if the Item_field is created based on a field in a temporary table that has no name. It is thus necessary to do a null check before attempting a strcmp.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3c36c2b514a..ea1eb0aa98e 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -7256,7 +7256,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
Item_field for tables.
*/
Item_ident *item_ref= (Item_ident *) item;
- if (item_ref->name && item_ref->table_name &&
+ if (field_name && item_ref->name && item_ref->table_name &&
!my_strcasecmp(system_charset_info, item_ref->name, field_name) &&
!my_strcasecmp(table_alias_charset, item_ref->table_name,
table_name) &&