Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
None
Description
SELECT
|
COALESCE(TIME'800:00:00', NOW()) AS c, |
HOUR(COALESCE(TIME'800:00:00',NOW())) AS hc; |
+---------------------+------+
|
| c | hc |
|
+---------------------+------+
|
| 2018-03-22 08:00:00 | 800 |
|
+---------------------+------+
|
The result for hc is wrong. It returns HOURS() of the first argument of COALESCE() before its conversion to DATETIME. The expected result is to return hours after conversion, i,e. 8, like the hour part in the first column c.
The same problem is repeatable with CASE and its abbreviations:
SELECT
|
CASE WHEN TRUE THEN TIME'800:00:00' ELSE NOW() END AS c, |
HOUR(CASE WHEN TRUE THEN TIME'800:00:00' ELSE NOW() END) AS hc; |
SELECT
|
IFNULL(TIME'800:00:00', NOW()) AS c, |
HOUR(IFNULL(TIME'800:00:00', NOW())) AS hc; |
SELECT
|
IF(TRUE,TIME'800:00:00', NOW()) AS c, |
HOUR(IF(TRUE,TIME'800:00:00', NOW())) AS hc; |
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
-
MDEV-8894 Inserting fractional seconds into MySQL 5.6 master breaks consistency on MariaDB 10 slave
- Closed
- is duplicated by
-
MDEV-15363 Wrong result for CAST(LAST_DAY(TIME'00:00:00') AS TIME)
- Closed