1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-14081 ALTER TABLE CHANGE COLUMN Corrupts Index Leading to Crashes in 10.2

remove remnants of 10.0 bugfix, incorrectly merged into 10.2

Using col_names[i] was obviously, wrong, must've been col_names[ifield->col_no].
incorrect column name resulted in innodb having index unique_id2(id1),
while the server thought it's unique_id2(id4).
But col_names[ifield->col_no] is wrong too, because `table` has non-renamed
columns, so the correct column name is always dict_table_get_col_name(table, ifield->col_no)
This commit is contained in:
Sergei Golubchik
2017-10-18 14:37:10 +02:00
parent e6df6031f6
commit 607d8f9e97
7 changed files with 29 additions and 33 deletions

View File

@ -11,3 +11,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
drop table t1;
set @@sql_mode=default;
create table t1 (
id1 int(11) not null auto_increment,
id2 varchar(30) not null,
id3 datetime not null default current_timestamp,
primary key (id1),
unique key unique_id2 (id2)
) engine=innodb;
alter table t1 change column id2 id4 varchar(100) not null;
select * from t1 where id4 like 'a';
id1 id4 id3
drop table t1;