[MCOL-79] NULLIF() function returns incorrect values Created: 2016-05-23  Updated: 2016-05-31  Resolved: 2016-05-31

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: None
Fix Version/s: 1.0.0

Type: Bug Priority: Minor
Reporter: Daniel Lee (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

Build tested:

getcalpontsoftwareinfo Mon May 23 16:47:57 2016

Name : infinidb-platform Relocations: (not relocatable)
Version : 5.0 Vendor: MariaDB, Inc.
Release : 0 Build Date: Sun 15 May 2016 07:24:29 PM CDT
Install Date: Mon 16 May 2016 05:21:51 PM CDT Build Host: srvbuilder
Group : Applications Source RPM: infinidb-5.0-0.src.rpm

The function return the first parameter value, instead of NULL, when the parameters are date and datetime data types. For the datetime parameter, the date portion is the same as the date, and the time portion is all 0s.

ColumnStore returns:

MariaDB [mytest]> select cidx, CDATE, CDATETIME, NULLIF(CDATE,CDATETIME) from datatypetestm order by cidx;
----------------------------------------------------------+

cidx CDATE CDATETIME NULLIF(CDATE,CDATETIME)

----------------------------------------------------------+

1 1997-01-01 1997-01-01 00:00:00 1997-01-01
2 1997-01-01 1997-01-01 00:00:01 1997-01-01
3 1997-01-02 1997-01-02 00:00:01 1997-01-02
4 1997-01-03 1997-01-03 00:00:02 1997-01-03
5 1997-01-04 1997-01-04 00:00:03 1997-01-04
6 2009-12-28 2009-12-31 23:59:56 2009-12-28
7 2009-12-29 2009-12-31 23:59:57 2009-12-29
8 2009-12-30 2009-12-31 23:59:58 2009-12-30
9 2009-12-31 2009-12-31 23:59:59 2009-12-31
10 2009-12-31 2009-12-31 23:59:59 2009-12-31
11 2009-12-31 2009-12-31 23:59:59 2009-12-31

----------------------------------------------------------+
11 rows in set (0.08 sec)

MySQL and MariaDB return:

MariaDB [tpch1]> select cidx, CDATE, CDATETIME, NULLIF(CDATE,CDATETIME) from DataTypeTestm order by cidx;
----------------------------------------------------------+

cidx CDATE CDATETIME NULLIF(CDATE,CDATETIME)

----------------------------------------------------------+

1 1997-01-01 1997-01-01 00:00:00 NULL
2 1997-01-01 1997-01-01 00:00:01 1997-01-01
3 1997-01-02 1997-01-02 00:00:01 1997-01-02
4 1997-01-03 1997-01-03 00:00:02 1997-01-03
5 1997-01-04 1997-01-04 00:00:03 1997-01-04
6 2009-12-28 2009-12-31 23:59:56 2009-12-28
7 2009-12-29 2009-12-31 23:59:57 2009-12-29
8 2009-12-30 2009-12-31 23:59:58 2009-12-30
9 2009-12-31 2009-12-31 23:59:59 2009-12-31
10 2009-12-31 2009-12-31 23:59:59 2009-12-31
11 2009-12-31 2009-12-31 23:59:59 2009-12-31

----------------------------------------------------------+
11 rows in set (0.00 sec)

Row 1 return incorrect value.



 Comments   
Comment by David Hall (Inactive) [ 2016-05-24 ]

For QA

Fix was in as MCOL-79 was written. Ported to new repository.

Comment by Dipti Joshi (Inactive) [ 2016-05-31 ]

dleeyh Please verify this and close if fixed.

Comment by Daniel Lee (Inactive) [ 2016-05-31 ]

Build verified:
getsoftwareinfo Tue May 31 10:30:28 2016

Name : mariadb-columnstore-platform Relocations: (not relocatable)
Version : 1.0 Vendor: MariaDB Corporation Ab
Release : 0 Build Date: Fri 27 May 2016 04:07:53 PM EDT
Install Date: Mon 30 May 2016 11:32:15 AM EDT Build Host: srvbuilder

MariaDB [mytest]> select cidx, CDATE, CDATETIME, NULLIF(CDATE,CDATETIME) from DataTypeTestm order by cidx;
----------------------------------------------------------+

cidx CDATE CDATETIME NULLIF(CDATE,CDATETIME)

----------------------------------------------------------+

1 1997-01-01 1997-01-01 00:00:00 NULL
2 1997-01-01 1997-01-01 00:00:01 1997-01-01
3 1997-01-02 1997-01-02 00:00:01 1997-01-02
4 1997-01-03 1997-01-03 00:00:02 1997-01-03
5 1997-01-04 1997-01-04 00:00:03 1997-01-04
6 2009-12-28 2009-12-31 23:59:56 2009-12-28
7 2009-12-29 2009-12-31 23:59:57 2009-12-29
8 2009-12-30 2009-12-31 23:59:58 2009-12-30
9 2009-12-31 2009-12-31 23:59:59 2009-12-31
10 2009-12-31 2009-12-31 23:59:59 2009-12-31
11 2009-12-31 2009-12-31 23:59:59 2009-12-31

----------------------------------------------------------+
11 rows in set (15.89 sec)

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