Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
10.0.0, 5.5.28, 5.3.9
-
None
-
None
-
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.
Attachments
Issue Links
- links to