diff options
author | Dmitry Lenev <dlenev@mysql.com> | 2009-10-09 19:18:52 +0400 |
---|---|---|
committer | Dmitry Lenev <dlenev@mysql.com> | 2009-10-09 19:18:52 +0400 |
commit | b8ffd1fb0ed8b50e2a26bc62389598ed4dea51e2 (patch) | |
tree | a773e2a04604a3554dc543a97dddc6d59ea57adc /sql | |
parent | 05f88483fb476c626b26a3fc2e0faca930f7bd7d (diff) | |
download | mariadb-git-b8ffd1fb0ed8b50e2a26bc62389598ed4dea51e2.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.
mysql-test/r/innodb_mysql.result:
Added test case for bug #39932 "create table fails if column for FK
is in different case than in corr index".
mysql-test/t/innodb_mysql.test:
Added test case for bug #39932 "create table fails if column for FK
is in different case than in corr index".
sql/sql_class.cc:
Make field name comparison case-insensitive like it is
in the rest of server.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_class.cc | 4 |
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); } /** |