Bug #56783 Modify column name will recreate table
Description:
In 5.1.34/40, I change a column name will not recreate table,
But in 5.1.46sp1, It will.
This function is disable? Or a bug?
In 5.1.34
create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32));
insert into a...... //add data
*************************** 1. row ***************************
Table: a
Create Table: CREATE TABLE `a` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`info` varchar(32) DEFAULT NULL,
`test` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
alter table a change test test1 varchar(32);
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
But in 5.1.46sp1:
create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32));
insert into a...... //add data
*************************** 1. row ***************************
Table: a
Create Table: CREATE TABLE `a` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`info` varchar(32) DEFAULT NULL,
`test` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
alter table a change test test1 varchar(32);
Query OK, 512 rows affected (0.38 sec)
Records: 512 Duplicates: 0 Warnings: 0
How to repeat:
In 5.1.34
create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32));
insert into a...... //add data
*************************** 1. row ***************************
Table: a
Create Table: CREATE TABLE `a` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`info` varchar(32) DEFAULT NULL,
`test` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
alter table a change test test1 varchar(32);
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
But in 5.1.46sp1:
create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32));
insert into a...... //add data
*************************** 1. row ***************************
Table: a
Create Table: CREATE TABLE `a` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`info` varchar(32) DEFAULT NULL,
`test` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
alter table a change test test1 varchar(32);
Query OK, 512 rows affected (0.38 sec)
Records: 512 Duplicates: 0 Warnings: 0
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: In 5.1.34/40, I change a column name will not recreate table, But in 5.1.46sp1, It will. This function is disable? Or a bug? In 5.1.34 create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32)); insert into a...... //add data *************************** 1. row *************************** Table: a Create Table: CREATE TABLE `a` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `info` varchar(32) DEFAULT NULL, `test` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8 1 row in set (0.00 sec) alter table a change test test1 varchar(32); Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 But in 5.1.46sp1: create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32)); insert into a...... //add data *************************** 1. row *************************** Table: a Create Table: CREATE TABLE `a` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `info` varchar(32) DEFAULT NULL, `test` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8 1 row in set (0.00 sec) alter table a change test test1 varchar(32); Query OK, 512 rows affected (0.38 sec) Records: 512 Duplicates: 0 Warnings: 0 How to repeat: In 5.1.34 create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32)); insert into a...... //add data *************************** 1. row *************************** Table: a Create Table: CREATE TABLE `a` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `info` varchar(32) DEFAULT NULL, `test` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8 1 row in set (0.00 sec) alter table a change test test1 varchar(32); Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 But in 5.1.46sp1: create table a(id int unsigned not null primary key auto_increment, info varchar(32), test varchar(32)); insert into a...... //add data *************************** 1. row *************************** Table: a Create Table: CREATE TABLE `a` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `info` varchar(32) DEFAULT NULL, `test` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1015 DEFAULT CHARSET=utf8 1 row in set (0.00 sec) alter table a change test test1 varchar(32); Query OK, 512 rows affected (0.38 sec) Records: 512 Duplicates: 0 Warnings: 0