Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL), 10.5
-
None
Description
Under terms of MDEV-20397 we modified functions ROUND() and TRUNCATE() to handle the TIME, DATETIME, TIMESTAMP data types correctly:
SELECT ROUND(time'00:00:01.9'), TRUNCATE(TIMESTAMP'2001-01-01 00:00:01.9',0); |
+-------------------------+----------------------------------------------+
|
| ROUND(time'00:00:01.9') | TRUNCATE(TIMESTAMP'2001-01-01 00:00:01.9',0) |
|
+-------------------------+----------------------------------------------+
|
| 00:00:02 | 2001-01-01 00:00:01 |
|
+-------------------------+----------------------------------------------+
|
But the functions CEILING() and FLOOR() still convert temporal data types to numbers:
SELECT CEILING(time'00:00:01.9'), FLOOR(TIMESTAMP'2001-01-01 00:00:01.9'); |
+---------------------------+-----------------------------------------+
|
| CEILING(time'00:00:01.9') | FLOOR(TIMESTAMP'2001-01-01 00:00:01.9') |
|
+---------------------------+-----------------------------------------+
|
| 2 | 20010101000001 |
|
+---------------------------+-----------------------------------------+
|
CEILING() and FLOOR() should be fixed to return TIME (for TIME input) and DATETIME (for DATETIME and TIMESTAMP input), like ROUND() and TRUNCATE() do.
Attachments
Issue Links
- relates to
-
MDEV-20397 Support TIMESTAMP, DATETIME, TIME in ROUND() and TRUNCATE()
- Closed
-
MDEV-23032 FLOOR()/CEIL() incorrectly calculate the precision of a DECIMAL(M,D) column.
- Closed