MDEV-4436 CHANGE COLUMN IF EXISTS does not work and throws wrong warning.
Use sql_field->change parameter as the name of the field.
This commit is contained in:
parent
3cf7e283a6
commit
06a91b18d7
@ -1899,3 +1899,11 @@ alter table t1 add key if not exists (i);
|
||||
Warnings:
|
||||
Note 1061 Duplicate key name 'i'
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int);
|
||||
alter table t1 change column if exists a b bigint;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`b` bigint(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
|
@ -1643,3 +1643,11 @@ alter table t1 add key (i);
|
||||
alter table t1 add key if not exists (i);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# MDEV-4436 CHANGE COLUMN IF EXISTS does not work and throws wrong warning.
|
||||
#
|
||||
create table t1 (a int);
|
||||
alter table t1 change column if exists a b bigint;
|
||||
show create table t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -5309,7 +5309,7 @@ handle_if_exists_options(THD *thd, TABLE *table, Alter_info *alter_info)
|
||||
for (f_ptr=table->field; *f_ptr; f_ptr++)
|
||||
{
|
||||
if (my_strcasecmp(system_charset_info,
|
||||
sql_field->field_name, (*f_ptr)->field_name) == 0)
|
||||
sql_field->change, (*f_ptr)->field_name) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user