|
I'm not sure we need to fix it. Current behavior is consistent — everything that causes a truncation warning during INSERT is rejected as a default value on CREATE. Compare:
- SET SQL_MODE=NO_ZERO_DATE; INSERT t1 (timestamp_column) VALUES (0);
- SET SQL_MODE=NO_ZERO_DATE; CREATE TABLE t2 (a TIMESTAMP 0);
- INSERT t3 (tinyint_column) VALUES (1000)
- CREATE TABLE t4 (a TINYINT 1000);
Both 1 and 3 will issue a truncation warning. Both 2 and 4 will fail. This is consistent.
After Oracle's fix for MySQL bug #11747847 - 34280, the 2 won't fail. But 4 still will.
This is inconsistent.
I'd prefer to leave it as is, or to fix both 2 and 4 not to fail, a.k.a. use the same logic in INSERT and CREATE.
|