From d1667fb837f9e5300dc9cc10f2cce72533188b83 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Tue, 20 Oct 2020 11:16:40 +0300 Subject: MDEV-23852 alter table rename column to uppercase doesn't work Case-sensitive compare to detect column name case change in inplace alter rename. --- sql/sql_table.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 345edf4d75c..31f165ef98a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7171,9 +7171,8 @@ static bool fill_alter_inplace_info(THD *thd, TABLE *table, bool varchar, ha_alter_info->handler_flags|= ALTER_STORED_COLUMN_TYPE; } - /* Check if field was renamed */ - if (lex_string_cmp(system_charset_info, &field->field_name, - &new_field->field_name)) + /* Check if field was renamed (case-sensitive for detecting case change) */ + if (cmp(&field->field_name, &new_field->field_name)) { field->flags|= FIELD_IS_RENAMED; ha_alter_info->handler_flags|= ALTER_COLUMN_NAME; -- cgit v1.2.1