Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 12.3.3
Description
On MariaDB 12.3.3, TIME(190794907) returns NULL when selected directly, but comparing it with its numeric argument returns TRUE. Adding +0 to the TIME() expression makes the comparison return NULL.
SELECT
|
TIME(190794907) AS direct, |
190794907 = TIME(190794907) AS comparison, |
190794907 = (TIME(190794907) + 0) AS numeric_comparison; |
 |
+--------+------------+--------------------+ |
| direct | comparison | numeric_comparison |
|
+--------+------------+--------------------+ |
| NULL | 1 | NULL | |
+--------+------------+--------------------+ |
Expected result:
+--------+------------+--------------------+
|
| direct | comparison | numeric_comparison |
|
+--------+------------+--------------------+
|
| NULL | NULL | NULL |
|
+--------+------------+--------------------+
|
Since TIME(190794907) evaluates to NULL, an ordinary equality comparison with that result should also evaluate to NULL, rather than TRUE.
The result suggests that TIME() is evaluated differently in temporal comparison context than when selected directly or used in numeric context.
Attachments
Issue Links
- relates to
-
MDEV-4837 Comparing a TIME value with an illegal time representation returns TRUE
-
- Confirmed
-
-
MDEV-17329 Inconsistency of NULL date value conversion to zero date in comparison context
-
- Open
-