[MCOL-1768] DATE_FORMAT() does not behave like MariaDB Created: 2018-10-04  Updated: 2021-02-20  Resolved: 2021-02-20

Status: Closed
Project: MariaDB ColumnStore
Component/s: N/A
Affects Version/s: 1.2.0
Fix Version/s: 5.5.1

Type: Bug Priority: Major
Reporter: Andrew Hutchings (Inactive) Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-1433 Some functions return non-matching re... Closed
Epic Link: Time, Timestamp and Timezone

 Description   

DATE_FORMAT doesn't behave the same as MariaDB for converting a time to a date. We would need to refactor the code for the function to make it behave the same.

DATE_FORMAT()
 
Reference:
 
MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%W %M %Y') from datatypetestm order by cidx;
-------------------------------------------
 
cidx	CTIME	DATE_FORMAT(CTIME,'%W %M %Y')
-------------------------------------------
 
1	13:00:00	NULL
-------------------------------------------
1 row in set (0.000 sec)
 
MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%D %y %a %d %m %b %j') from datatypetestm order by cidx;
-------------------------------------------------------
 
cidx	CTIME	DATE_FORMAT(CTIME,'%D %y %a %d %m %b %j')
-------------------------------------------------------
 
1	13:00:00	NULL
-------------------------------------------------------
1 row in set (0.000 sec)
 
ColumnStore:
 
MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%W %M %Y') from datatypetestm order by cidx;
-------------------------------------------
 
cidx	CTIME	DATE_FORMAT(CTIME,'%W %M %Y')
-------------------------------------------
 
1	13:00:00	Monday October 2018
-------------------------------------------
1 row in set (0.031 sec)
 
MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%D %y %a %d %m %b %j') from datatypetestm order by cidx;
-------------------------------------------------------
 
cidx	CTIME	DATE_FORMAT(CTIME,'%D %y %a %d %m %b %j')
-------------------------------------------------------
 
1	13:00:00	1st 18 Mon 01 10 Oct 274
-------------------------------------------------------
1 row in set (0.007 sec)


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