summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-11-13 11:39:52 +0200
committerunknown <gkodinov/kgeorge@magare.gmz>2007-11-13 11:39:52 +0200
commit170ae2d252ad1c9c52afdb8864a1083bde2efa2b (patch)
tree2b9de45824a2f6095072c8b9b3e1685fe8193655 /sql/sql_base.cc
parenta5d7fa746fd6db971d465f5072b6cfec8f28e2fb (diff)
downloadmariadb-git-170ae2d252ad1c9c52afdb8864a1083bde2efa2b.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 mysql-test/r/lowercase_view.result: Bug #31562: test case mysql-test/t/lowercase_view.test: Bug #31562: test case sql/item.cc: Bug #31562: lower_case_table_name contious comparison when searching in GROUP BY sql/sql_base.cc: Bug #31562: lower_case_table_name contious comparison when searching in SELECT sql/sql_select.cc: Bug #31562: treat table aliases as table names and make them lowercase when printing
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b206e4a6e03..fd921be1ecf 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4164,7 +4164,8 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
if (item_field->field_name && item_field->table_name &&
!my_strcasecmp(system_charset_info, item_field->field_name,
field_name) &&
- !strcmp(item_field->table_name, table_name) &&
+ !my_strcasecmp(table_alias_charset, item_field->table_name,
+ table_name) &&
(!db_name || (item_field->db_name &&
!strcmp(item_field->db_name, db_name))))
{