[MDEV-6102] Comparison between TIME and DATETIME does not use CURRENT_DATE Created: 2014-04-15  Updated: 2018-06-20  Resolved: 2014-06-06

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.10
Fix Version/s: 10.0.12

Type: Bug Priority: Critical
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: compat56

Issue Links:
Blocks
blocks MDEV-6001 Merge tests for MySQL WL#946 TIME/DAT... Stalled
Relates
relates to MDEV-16532 Equality checks between now() and tim... Closed

 Description   

This SQL script:

SET timestamp=UNIX_TIMESTAMP('2014-04-14 10:20:30');
SELECT CAST(TIME'10:20:30' AS DATETIME), TIME'10:20:30'=TIMESTAMP'2014-04-14 10:20:30' AS cmp;

demonstrates that conversion between TIME and DATETIME
does not add CURRENT_DATE to TIME.

+----------------------------------+-----+
| CAST(TIME'10:20:30' AS DATETIME) | cmp |
+----------------------------------+-----+
| 2014-04-14 10:20:30              |   0 |
+----------------------------------+-----+

MySQL-5.6 returns "1" in the "cmp" field in the same scenario.


Generated at Thu Feb 08 07:09:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.