Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-79

NULLIF() function returns incorrect values

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.0
    • ExeMgr
    • 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.

      Attachments

        Activity

          People

            dleeyh Daniel Lee (Inactive)
            dleeyh Daniel Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.