Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
5.5.25, 5.3.7
-
None
-
None
Description
|
create table t1 (d datetime);
|
# Query OK, 0 rows affected (0.22 sec)
|
|
insert into t1 values ('9999-12-31 23:59:59');
|
# Query OK, 1 row affected (0.00 sec)
|
|
update t1 set d = addtime(d, '00:00:01');
|
# Query OK, 1 row affected (0.00 sec)
|
# Rows matched: 1 Changed: 1 Warnings: 0
|
|
select * from t1 where d > '9999-12-31 23:59:59';
|
# +---------------------+
|
# | d |
|
# +---------------------+
|
# | :000-01-01 00:00:00 |
|
# +---------------------+
|
# 1 row in set (0.00 sec)
|
This can potentially cause problems; for one, mysqldump/restore brings up a different value (all zeros).
In MariaDB 5.2 it worked as expected – a warning 'Incorrect datetime value: '10000-01-01 00:00:00'' was produced on the update, and the value was set to NULL.