What will happen if I change the type of a column from int to year?
- by MachinationX
I have a table in MySQL 4.0 which currently has a year field as a smallint(6) type. What will happen if I convert it directly to a Year type with a query like the following:
ALTER TABLE t MODIFY y YEAR(4) NOT NULL DEFAULT CURRENT_TIMESTAMP;
When the current members of column y have values like 2010? I assume that because the year type is technically values from 1-255, values above that will be truncated or broken.
So if MySQL isn't smart enough to realize that 2010(int) = 110(year), what would be the simplest query or queries to convert the values?
Thanks for your help!