TIME datatype is not supported
(MCOL-392)
|
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.0 |
| Type: | Sub-Task | Priority: | Critical |
| Reporter: | Daniel Lee (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 2018-08, 2018-09, 2018-10, 2018-11, 2018-12, 2018-13, 2018-14, 2018-15, 2018-16, 2018-17, 2018-18 | ||||||||||||
| Description |
|
The following distributed functions in ColumnStore failed functions test after TIME data type was added to the test suite. I have checked some of these functions and found that they are not handling the TIME data type correctly. The functions test suite is part of the Autopilot/features test. It compared results returned by MariaDB server and ColumnStore. CAST |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2018-06-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Can you please provide your CAST, CONVERT, TIMEDIFF, STR_TO_DATE, NULLIF, MAKEDATE, DATE_FORMAT, DATEDIFF and TIMESTAMPDIFF tests? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-06-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The following were moved to period_add() This puts them out of scope of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-06-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Have a pull request that fixes everything else. Just need feedback from dleeyh on the requested functions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-06-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
CAST, CONVERT, TIMEDIFF, STR_TO_DATE, NULLIF, MAKEDATE, DATE_FORMAT, DATEDIFF and TIMESTAMPDIFF do not seem to cause a problem in develop any more. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-06-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pull request in engine fixes most of the problem functions. The rest are either no longer a problem or are in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2018-06-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Some functions still returning incorrect results 1. CAST, CONVERT, STR_TO_DATE When casting/converting TIME to DATE and DATETIME, it returns NULL. It should return DATE and DATETIME value, respectively. 1 -------------- [root@localhost functions]# cat -n CNX/STR_TO_DATE.DM.sql.tst.log 42 select cidx, CTIME, STR_TO_DATE(DATE_FORMAT(CTIME,GET_FORMAT(DATETIME,'USA')), GET_FORMAT(DATETIME,'USA')) from datatypetestm order by cidx 2. TIMEDIFF When timediff with a literal date time value, it returns the minimum TIME value, instead of NULL [root@localhost functions]# cat -n CNX/TIMEDIFF.DM.sql.tst.log [root@localhost functions]# cat -n CNX/TIMEDIFF.DM.sql.ref.log 3. NULLIF CTIME and CDATE are not the same they it should not return NULL [root@localhost functions]# cat -n CNX/NULLIF.DM.sql.tst.log [root@localhost functions]# cat -n CNX/NULLIF.DM.sql.ref.log 4. MAKEDATE [root@localhost functions]# cat -n CNX/MAKEDATE.DM.sql.tst.log [root@localhost functions]# cat -n CNX/MAKEDATE.DM.sql.ref.log 5. DATE_FORMAT [root@localhost functions]# cat -n CNX/DATE_FORMAT.DM.sql.tst.log [root@localhost functions]# cat -n CNX/DATE_FORMAT.DM.sql.ref.log 6. DATEDIFF The DATEDIFF output is off by 1 [root@localhost functions]# cat -n CNX/DATEDIFF.DM.sql.tst.log [root@localhost functions]# cat -n CNX/DATEDIFF.DM.sql.ref.log | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
All of the flagged problems in Daniel's comment should now be fixed in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2018-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build tested: Github source /root/columnstore/mariadb-columnstore-server /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine Some of the functions were fixed. There are still a few with non-matching results. They are TIMEDIFF(), MAKE_DATE(), and DATE_FORMAT(). STR_TO_DATE() seems to be correct. The test return incorrect result because the DATE_FORMAT is used in the query. TIMEDIFF() Reference: MariaDB [mytest]> select cidx, CTIME, TIMEDIFF(CTIME,'2007-02-28 22:23:0') from datatypetestm order by cidx;
-----
----- ColumnStore: MariaDB [mytest]> select cidx, CTIME, TIMEDIFF(CTIME,'2007-02-28 22:23:0') from datatypetestm order by cidx;
-----
----- MAKEDATE() Reference: MariaDB [mytest]> select cidx, CTIME, MAKEDATE(2010, CTIME) from datatypetestm order by cidx;
-----
----- MariaDB [mytest]> select cidx, CTIME, MAKEDATE(2011, CTIME) from datatypetestm order by cidx;
-----
----- ColumnStore: MariaDB [mytest]> select cidx, CTIME, MAKEDATE(2010, CTIME) from datatypetestm order by cidx;
-----
----- MariaDB [mytest]> select cidx, CTIME, MAKEDATE(2011, CTIME) from datatypetestm order by cidx;
-----
----- DATE_FORMAT() Reference: MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%W %M %Y') from datatypetestm order by cidx;
-----
----- MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%D %y %a %d %m %b %j') from datatypetestm order by cidx;
-----
----- ColumnStore: MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%W %M %Y') from datatypetestm order by cidx;
-----
----- MariaDB [mytest]> select cidx, CTIME, DATE_FORMAT(CTIME,'%D %y %a %d %m %b %j') from datatypetestm order by cidx;
-----
----- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-10-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've moved DATE_FORMAT() to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-10-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fixed MAKEDATE and TIMEDIFF. TIMEDIFF doesn't like mixed DATETIME/TIME type input in MariaDB so we now block that. MAKEDATE was using the wrong integer representation of time for the conversion. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2018-10-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build tested: 1.2.0-1 source Build verified: 1.2.0-1 source test and reference results matched. |