Bug #115088 different time rounding in Insert and select

Submitted: 23 May 2024 3:23 Modified: 12 Dec 2025 21:05
Reporter: Ecee no Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.3.0, 5.7, 8.0 OS:Windows
Assigned to: CPU Architecture:Any

[23 May 2024 3:23] Ecee no
Description:
Time rounding may be different in Insert and Select.

How to repeat:
1. 
select maketime(2.2/time '08:30:23.01',2.2/time '08:30:23.01',2.2/time '08:30:23.01') f14;
2.
select * from (select maketime(2.2/time '08:30:23.01',2.2/time '08:30:23.01',2.2/time '08:30:23.01')) f14;
drop view if exists v1;
CREATE OR REPLACE VIEW v1 as select maketime(2.2/time '08:30:23.01',2.2/time '08:30:23.01',2.2/time '08:30:23.01') f14;
select * from v1;
drop table if exists t1;
CREATE table t1 as select maketime(2.2/time '08:30:23.01',2.2/time '08:30:23.01',2.2/time '08:30:23.01') f14;
select * from t1;

Suggested fix:
I think the data in the select and insert operations should be consistent.
[23 May 2024 7:33] MySQL Verification Team
Hello Ecee no,

Thank you for the report and test case.

regards,
Umesh
[24 May 2024 3:09] Ecee no
1. reuslt is 00:00:00.00002
select maketime(2.4/time '08:30:23.01',2.4/time '08:30:23.01',2.4/time '08:30:23.01') f14;

2. reuslt is 00:00:00.00003
select * from (select maketime(2.4/time '08:30:23.01',2.4/time '08:30:23.01',2.4/time '08:30:23.01')) f14;

drop view if exists v1;
CREATE OR REPLACE VIEW v1 as select maketime(2.4/time '08:30:23.01',2.4/time '08:30:23.01',2.4/time '08:30:23.01') f14;
select * from v1;

drop table if exists t1;
CREATE table t1(f14 time(6)) as select maketime(2.4/time '08:30:23.01',2.4/time '08:30:23.01',2.4/time '08:30:23.01') f14;
select * from t1;

Could you respond to that? Why are the results different? Is this expected behavior or a bug?
Thanks.
[12 Dec 2025 21:05] Roy Lyseng
Posted by developer:
 
Not repeatable in version 9.5.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.