summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-04-06 15:29:15 -0700
committerunknown <igor@rurik.mysql.com>2006-04-06 15:29:15 -0700
commit998b9d8b14892a91ad32fd1be83f9d60fddba98d (patch)
tree125a1e037e2b10337945e300958855f608950261 /sql
parent8ec7190dacbbc8dbdd2c985b22991a20be720a47 (diff)
downloadmariadb-git-998b9d8b14892a91ad32fd1be83f9d60fddba98d.tar.gz
Fixed bug #15917: unexpected complain for a NIST test case.
The problem was due to the fact that with --lower-case-table-names set to 1 the function find_field_in_group did not convert the prefix 'HU' in HU.PROJ.CITY into lower case when looking for it in the group list. Yet the names in the group list were extended by the database name in lower case. mysql-test/r/having.result: Added a test case for bug #15917. mysql-test/t/having.test: Added a test case for bug #15917. sql/item.cc: Fixed bug #15917: unexpected complain for a NIST test case. The problem was due to the fact that with --lower-case-table-names set to 1 the function find_field_in_group did not convert the prefix 'HU' in HU.PROJ.CITY into lower case when looking for it in the group list. Yet the names in the group list were extended by the database name in lower case. The needed conversion was added to the code of find_field_in_group.
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index e1bde85e200..e3da950ceef 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3054,6 +3054,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
int found_match_degree= 0;
Item_ident *cur_field;
int cur_match_degree= 0;
+ char name_buff[NAME_LEN+1];
if (find_item->type() == Item::FIELD_ITEM ||
find_item->type() == Item::REF_ITEM)
@@ -3065,6 +3066,14 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
else
return NULL;
+ if (db_name && lower_case_table_names)
+ {
+ /* Convert database to lower case for comparison */
+ strmake(name_buff, db_name, sizeof(name_buff)-1);
+ my_casedn_str(files_charset_info, name_buff);
+ db_name= name_buff;
+ }
+
DBUG_ASSERT(field_name != 0);
for (ORDER *cur_group= group_list ; cur_group ; cur_group= cur_group->next)