[MCOL-4161] Add full support for Hour/Minute/Second to UNIX_TIMESTAMP() function Created: 2020-07-10  Updated: 2023-10-27  Resolved: 2023-10-27

Status: Closed
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: 1.2.4, 1.4.3, 1.5.3
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Gagan Goel (Inactive) Assignee: Leonid Fedorov
Resolution: Won't Fix Votes: 0
Labels: beginner-friendly

Issue Links:
Relates
relates to MCOL-641 Full DECIMAL support in ColumnStore Closed

 Description   

UNIX_TIMESTAMP() function currently does not handle hour/minute/second for the integer types, including decimal, as well as for char/varchar/text types. As can be seen below, results don't match the correct output (innodb):

MariaDB [test]> create table cs2 (a decimal(18))engine=columnstore;
Query OK, 0 rows affected (0.242 sec)
 
MariaDB [test]> insert into cs2 values (20201028183200);
Query OK, 1 row affected (0.237 sec)
 
MariaDB [test]> select unix_timestamp(a) from cs2;
+-------------------+
| unix_timestamp(a) |
+-------------------+
|        1603857600 |
+-------------------+
1 row in set (0.151 sec)
 
MariaDB [test]> create table i2 as select * from cs2;
Query OK, 1 row affected (0.047 sec)
Records: 1  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select unix_timestamp(a) from i2;
+-------------------+
| unix_timestamp(a) |
+-------------------+
|        1603924320 |
+-------------------+
1 row in set (0.002 sec)


Generated at Thu Feb 08 02:48:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.