summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorDmitry Lenev <dlenev@mysql.com>2009-10-09 19:18:52 +0400
committerDmitry Lenev <dlenev@mysql.com>2009-10-09 19:18:52 +0400
commit268da1b1d3f7f30ce48b7da4b1fa69e40c2278a5 (patch)
treea773e2a04604a3554dc543a97dddc6d59ea57adc /sql/sql_class.cc
parent43bf01e3372932c32f087aee74e9df83ad89e1c1 (diff)
downloadmariadb-git-268da1b1d3f7f30ce48b7da4b1fa69e40c2278a5.tar.gz
Fix for bug #39932 "create table fails if column for FK is in different
case than in corr index". Server was unable to find existing or explicitly created supporting index for foreign key if corresponding statement clause used field names in case different than one used in key specification and created yet another supporting index. In cases when name of constraint (and thus name of generated index) was the same as name of existing/explicitly created index this led to duplicate key name error. The problem was that unlike all other code Key_part_spec::operator==() compared field names in case sensitive fashion. As result routines responsible for getting rid of redundant generated supporting indexes for foreign key were not working properly for versions of field names using different cases.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index b764026048a..77f78d80c12 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -91,8 +91,8 @@ extern "C" void free_user_var(user_var_entry *entry)
bool Key_part_spec::operator==(const Key_part_spec& other) const
{
return length == other.length &&
- field_name.length == other.field_name.length &&
- !strcmp(field_name.str, other.field_name.str);
+ !my_strcasecmp(system_charset_info, field_name.str,
+ other.field_name.str);
}
/**