WL#4776: Alter Data Type

Affects: Server-9.x   —   Status: Un-Assigned

There is a new ALTER ... SET DATA TYPE clause in SQL:2008:
ALTER TABLE table_name
ALTER [ COLUMN ] column_name
SET DATA TYPE data_type;

This differs from ALTER ... MODIFY clause in MySQL 5.1:
ALTER TABLE table_name
MODIFY [COLUMN] col_name column_definition;
It's more than a change in wording -- MySQL's idea
of a "column definition" includes COMMENT, DEFAULT,
NOT NULL, etc. So the standard-SQL clause is better
if data type is the only thing one wants to change.

Some details from SQL:2008 Foundation
section :

* The ALTER should fail if the column is mentioned in a
  trigger, routine body, view, etc.

* The new data type must be in the same category as the
  old one (for example exact numeric) and the new length
  must be greater than or equal to the old one.

This is Non-Core Feature F382 "Alter column data type".

References:
BUG#42628 column comment deleted after changing charset/collation for column by
statement

[ Peter Gulutzan 2009-02-06 ]