[MDEV-20695] UNIX_TIMESTAMP for TIME type returns null Created: 2019-09-29  Updated: 2019-10-02

Status: Confirmed
Project: MariaDB Server
Component/s: Data types, Temporal Types
Affects Version/s: 10.4.8, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Matthew Peveler Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None


 Description   

In MariaDB 10.4, running SELECT UNIX_TIMESTAMP(TIME'18:30:00') returns null. In prior versions of MariaDB, it would return the timestamp of current date + the specified TIME (e.g. SELECT UNIX_TIMESTAMP(TIME'18:30:00') -> 1569781800).

I tested using Docker 10.4, 10.3, and 10.1 where 10.1 and 10.3 returned the expected result and 10.4 returned null.



 Comments   
Comment by Matthew Peveler [ 2019-09-29 ]

I can get the old behavior by doing SELECT UNIX_TIMESTAMP(CONCAT(CURRENT_DATE(), ' ', CONVERT(TIME'18:30:00', CHARACTER))).

Perhaps a better use case for the above would be SELECT UNIX_TIMESTAMP(CURRENT_TIME) returns null for 10.4.

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