Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31722

NULLIF returns wrong result if expr1 ≠ expr2 and expr1 has type YEAR(2)/YEAR(4)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.9, 10.10, 11.0, 11.1, 11.2
    • 10.4, 10.5, 10.6, 11.1, 11.2
    • None
    • None

    Description

      Testcase:

      CREATE TABLE t1 (a YEAR(2));
      INSERT INTO t1 VALUES (0);
      SELECT a, NULLIF(a,2001), NULLIF(2001,a) FROM t1;
      DROP TABLE t1;
      

      Expected result:

      a	NULLIF(a,2001)	NULLIF(2001,a)
      00	00	2001
      

      Actual result:

      a	NULLIF(a,2001)	NULLIF(2001,a)
      00	0	2001
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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