Bug #3394 ALTER TABLE MODIFY COL has wrong error message
Submitted: 5 Apr 2004 15:53 Modified: 27 Apr 2004 8:33
Reporter: Peter Zaitsev (Basic Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.18 OS:Any (all)
Assigned to: Antony Curtis CPU Architecture:Any

[5 Apr 2004 15:53] Peter Zaitsev
Description:
As you can see below error message is confusing - the column "c" exists in this table.    If you can't have the same column referenced twice by modify it is perhaps better to have other error message;

How to repeat:
mysql> create table mdf(c int);
Query OK, 0 rows affected (0.72 sec)

mysql> alter table mdf modify c tinyint, modify c tinyint;
ERROR 1054: Unknown column 'c' in 'mdf'
[27 Apr 2004 8:33] Michael Widenius
Sorry, but no new error messages in 4.0. (Too many problems with merge to newer MySQL versions).

As this is not something that is typical in normal code, I don't see a reason to spend time to do a special error message for this case.

The problem is that when MySQL sees the second modify command, there is no 'c' column available for it to change, so the error message is 'kind of correct'.