Bug #23611 MySQL shouldn't do a full table copy just to rename a column
Submitted: 25 Oct 2006 4:08 Modified: 26 Oct 2006 23:43
Reporter: Ask Hansen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.26 OS:
Assigned to: CPU Architecture:Any
Tags: innodb, myisam

[25 Oct 2006 4:08] Ask Hansen
Description:
MySQL always does a full table copy on "alter table", even when the only change is a column name.

How to repeat:
create table test ( id int unsigned not null, foo blob );
... load lots of data into test ...
alter table test change foo bar blob;

watch the alter table take forever.

Suggested fix:
Make alter table fast when the only change is a column renaming.
[25 Oct 2006 13:16] Valeriy Kravchuk
Thank you for a reasonable feature request. It is a known problem, work in progress already.
[26 Oct 2006 19:32] Sergei Golubchik
It is fixed in 5.1. See bug#21704
[26 Oct 2006 23:43] Ask Hansen
Sergei,

#23611 doesn't mention this at all, but I'll take your word for it...

 - ask
[26 Oct 2006 23:43] Ask Hansen
(eh, of course * bug#21704 * doesn't mention this at all).
[27 Oct 2006 7:48] Sergei Golubchik
That bug is about foreign key constraints that were broken with optimized ALTER TABLE. If you scroll the bugreport down to Ingo's comment, you'll find more details there.