Bug #76948 mysql 5.6 rounds microseconds
Submitted: 6 May 2015 9:13 Modified: 6 May 2015 13:02
Reporter: Denis Pimenov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.6.19 OS:Any
Assigned to: CPU Architecture:Any

[6 May 2015 9:13] Denis Pimenov
Description:
In mysql 5.6 microseconds  were added  to datetime type. But we use old tables without microseconds and our logic matches this fact.  And now mysql behaviour changed: 5.5  rounded values, but 5.6 truncates them. 
Our java code create Date objects without truncating and this trouble  for us. 
Can you change behaviour, may be optionally?

mariadb truncates microseconds:
https://mariadb.com/kb/en/mariadb/microseconds-in-mariadb/

"Note: When you convert a temporal value to a value with a smaller precision, it will be truncated, not rounded. This is done to guarantee that the date part is not changed"

we want the same behaviour from mysql 5.6. 

How to repeat:
CREATE TABLE `test` (
  `time` datetime NOT NULL,
  PRIMARY KEY (`time`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1251;

INSERT INTO test (time) VALUES ("2015-04-30 23:59:59.999");

1) mysql 5.6(round) :

select * from test;
+---------------------+
| time                |
+---------------------+
| 2015-05-01 00:00:00 |
+---------------------+
1 row in set (0.00 sec)

2) mysql 5.5(truncate)
select * from test;
+---------------------+
| time                |
+---------------------+
| 2015-04-30 23:59:59 |
+---------------------+
1 row in set (0.00 sec)
[6 May 2015 9:19] Denis Pimenov
Sorry for mistake in my description "And now mysql behaviour changed: 5.5  rounded values, but 5.6 truncates them. "   Vice versa: "And now mysql behaviour changed: 5.5  truncated values, but 5.6 rounds them.
[6 May 2015 9:22] MySQL Verification Team
Seen http://bugs.mysql.com/bug.php?id=68760 ?
[6 May 2015 9:44] Denis Pimenov
Yes, this is duplicate  bug. I haven't seen it. And it's not fixed yet, and still where is no comments from developers.
[6 May 2015 13:02] MySQL Verification Team
Duplicate of bug mentioned by Shane.