summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-11-13 11:39:52 +0200
committergkodinov/kgeorge@magare.gmz <>2007-11-13 11:39:52 +0200
commit3384d3e96c459cc2789c912261541f2b4eb13818 (patch)
tree2b9de45824a2f6095072c8b9b3e1685fe8193655 /sql/item.cc
parent00e897ac905a893407939791cb28fa192c91c136 (diff)
downloadmariadb-git-3384d3e96c459cc2789c912261541f2b4eb13818.tar.gz
Bug #31562: HAVING and lower case
The columns in HAVING can reference the GROUP BY and SELECT columns. There can be "table" prefixes when referencing these columns. And these "table" prefixes in HAVING use the table alias if available. This means that table aliases are subject to the same storage rules as table names and are dependent on lower_case_table_names in the same way as the table names are. Fixed by : 1. Treating table aliases as table names and make them lowercase when printing out the SQL statement for view persistence. 2. Using case insensitive comparison for table aliases when requested by lower_case_table_names
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index dc3b1fc6b79..538f23980d6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3307,7 +3307,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
if (cur_field->table_name && table_name)
{
/* If field_name is qualified by a table name. */
- if (strcmp(cur_field->table_name, table_name))
+ if (my_strcasecmp(table_alias_charset, cur_field->table_name, table_name))
/* Same field names, different tables. */
return NULL;