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

"datetime >= coalesce(c1(NULL))" doesn't return expected NULL

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.1.10, 5.3.13, 5.5(EOL), 10.0(EOL), 10.1(EOL)
    • 5.5.49
    • Temporal Types
    • None
    • 10.0.25

    Description

      Output:

      mysql> create table t1(c1 timestamp(6) null default null);
      Query OK, 0 rows affected (0.01 sec)
       
      mysql> insert into t1 values(NULL);
      Query OK, 1 row affected (0.00 sec)
       
      mysql> select c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) from t1;
      +------+------------------------------------------------+
      | c1   | '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) |
      +------+------------------------------------------------+
      | NULL |                                              1 |
      +------+------------------------------------------------+
      1 row in set (0.00 sec)
       
      mysql>
      mysql> select version();
      +-----------------+
      | version()       |
      +-----------------+
      | 10.1.10-MariaDB |
      +-----------------+
      1 row in set (0.00 sec)
       

      Recreate:

       
      drop table if exists t1;
      create table t1(c1 timestamp(6) null default null);
      insert into t1 values(NULL);
      select c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) from t1;
       
       

      Problem:
      NULL is expected.

      Attachments

        Activity

          dylan Dylan Su created issue -
          dylan Dylan Su made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Critical [ 2 ]
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]

          Thanks for the report and the test case.

          Not reproducible with MySQL 5.5, 5.6, 5.7.

          elenst Elena Stepanova added a comment - Thanks for the report and the test case. Not reproducible with MySQL 5.5, 5.6, 5.7.
          elenst Elena Stepanova made changes -
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Affects Version/s 5.3.13 [ 12602 ]
          Affects Version/s 5.5 [ 15800 ]
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 10.1 [ 16100 ]
          Assignee Alexander Barkov [ bar ]
          serg Sergei Golubchik made changes -
          Sprint 10.0.25 [ 50 ]
          bar Alexander Barkov made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]

          The patch for MDEV-9521 fixed this problem as well.

          bar Alexander Barkov added a comment - The patch for MDEV-9521 fixed this problem as well.
          bar Alexander Barkov made changes -
          Component/s Data Definition - Temporary [ 10123 ]
          Fix Version/s 5.5.49 [ 21600 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          bar Alexander Barkov made changes -
          Component/s Temporal Types [ 11000 ]
          Component/s Data Definition - Temporary [ 10123 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 73639 ] MariaDB v4 [ 150001 ]

          People

            bar Alexander Barkov
            dylan Dylan Su
            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.