Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
To write mtr tests easier, we'll add CAST(x AS INTERVAL DAY_SECOND(N)).
For now it will return a VARCHAR with a specific format:
[+][DD ]hh:mm:ss[.ffffff]
|
It will be helpful to write tests with functions that now understand long time intervals:
- TIMESTMP(ts, time_interval)
- ADDTIME(ts, time_interval)
- EXTRACT(DAY FROM src)
So in this query:
SELECT
|
CAST(1223344.123456 AS INTERVAL DAY_SECOND(6)) AS cast_itds, |
EXTRACT(DAY FROM 1223344.123456) AS d, |
EXTRACT(HOUR FROM 1223344.123456) AS h; |
+-------------------+------+------+
|
| cast_itds | d | h |
|
+-------------------+------+------+
|
| 5 02:33:44.123456 | 5 | 2 |
|
+-------------------+------+------+
|
it will be clear how the day and the hour value are calculated.
Attachments
Issue Links
- blocks
-
MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP
- Closed
- relates to
-
MDEV-17351 Wrong results for GREATEST,TIMESTAMP,ADDTIME with an out-of-range TIME-alike argument
- Closed
-
MDEV-17740 Extend EXTRACT(x AS DAY*) to understand long time intervals
- Closed