Bug #56783 Modify column name will recreate table
Submitted: 15 Sep 2010 5:28 Modified: 11 Nov 2010 0:21
Reporter: Lixun Peng (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1.46sp1 OS:Linux (RHEL 5.4)
Assigned to: CPU Architecture:Any

[15 Sep 2010 5:28] Lixun Peng
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
[11 Nov 2010 0:21] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of bug #57832