summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2010-09-01 19:38:34 +0200
committerMagne Mahre <magne.mahre@sun.com>2010-09-01 19:38:34 +0200
commit24fc7ca4c8899c71a4a6572987d7567e17eefcec (patch)
treeb7d0cc6b9592b38b581e7cc5f423b99ef7cc6b46 /sql/sql_class.cc
parenta73b734949dde2725ed0bddaceef79c9be581ff8 (diff)
downloadmariadb-git-24fc7ca4c8899c71a4a6572987d7567e17eefcec.tar.gz
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. (backported from mysql-trunk)
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 7c52e6957cc..44bb6d51c6c 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -91,7 +91,9 @@ 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 && !strcmp(field_name, other.field_name);
+ return length == other.length &&
+ !my_strcasecmp(system_charset_info, field_name,
+ other.field_name);
}
/**