Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 10.0.0, 5.5.28, 5.3.9
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
With sql_mode='NO_ZERO_DATE' MariaDB 5.1-10.0 and MySQL 5.1-5.5 throw an error on an attempt to create a table with a default zero date, e.g.
set sql_mode='NO_ZERO_DATE'; # Query OK, 0 rows affected (0.00 sec) CREATE TABLE t1 (d datetime default 0); # ERROR 1067 (42000): Invalid default value for 'd'
But MySQL 5.6 in the same situation only produces a warning:
SET sql_mode='NO_ZERO_DATE'; # Query OK, 0 rows affected (0.00 sec) CREATE TABLE t1 (d datetime default 0); # Query OK, 0 rows affected, 1 warning (2.32 sec) SHOW WARNINGS; # +---------+------+--------------------------------------------+ # | Level | Code | Message | # +---------+------+--------------------------------------------+ # | Warning | 1264 | Out of range value for column 'd' at row 1 | # +---------+------+--------------------------------------------+ # 1 row in set (0.00 sec)
As a result, replication from MySQL 5.6 to MariaDB 10.0 fails with 'Invalid default value for 't'' on query.
Same is true for NO_ZERO_IN_DATE and corresponding values.
Gliffy Diagrams
Attachments
Issue Links
- links to
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
We won't fix this issue.
MySQL's behavior has changed in a revid:raveenkumar.hulakund@oracle.com-20120319175914-0wm47wvsglkl24ui as a fix for http://bugs.mysql.com/34280
In fact, the bug report is incorrect - the issue is not at all specific to invalid dates, all invalid values (numbers and strings too) in defaults are rejected. One can easily see from the test cases and bugdb that this was done to fix bug http://bugs.mysql.com/5903
Now Oracle has re-introduced this bug, that allows to break the data consistency and insert invalid data in the TRADITIONAL mode.
We won't do that.