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

IN operator with ( num, NULL ) gives inconsistent result

Details

    • 5.5.48-0, 10.1.13

    Description

      Output:

      mysql> select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));
      +-------------------------------+-------------------------+-------------------------+
      | (1,null) not in ((2,2),(3,3)) | (1,null) not in ((2,2)) | (1,null) not in ((3,3)) |
      +-------------------------------+-------------------------+-------------------------+
      |                          NULL |                       1 |                       1 |
      +-------------------------------+-------------------------+-------------------------+
      1 row in set (0.00 sec)
       
      mysql> select version();
      +-----------------+
      | version()       |
      +-----------------+
      | 10.1.10-MariaDB |
      +-----------------+
      1 row in set (0.00 sec)

      Recreate:

      select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));

      Problem:
      ========
      (1,null) not in ((2,2),(3,3)) is expected to return true.

      Attachments

        Activity

          dylan Dylan Su created issue -
          dylan Dylan Su made changes -
          Field Original Value New Value
          Description Output:
          ======
          mysql> select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));
          +-------------------------------+-------------------------+-------------------------+
          | (1,null) not in ((2,2),(3,3)) | (1,null) not in ((2,2)) | (1,null) not in ((3,3)) |
          +-------------------------------+-------------------------+-------------------------+
          | NULL | 1 | 1 |
          +-------------------------------+-------------------------+-------------------------+
          1 row in set (0.00 sec)

          mysql> select version();
          +-----------------+
          | version() |
          +-----------------+
          | 10.1.10-MariaDB |
          +-----------------+
          1 row in set (0.00 sec)


          Problem:
          ========
          (1,null) not in ((2,2),(3,3)) is expected to return true.
          Output:
          ======
          mysql> select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));
          +-------------------------------+-------------------------+-------------------------+
          | (1,null) not in ((2,2),(3,3)) | (1,null) not in ((2,2)) | (1,null) not in ((3,3)) |
          +-------------------------------+-------------------------+-------------------------+
          | NULL | 1 | 1 |
          +-------------------------------+-------------------------+-------------------------+
          1 row in set (0.00 sec)

          mysql> select version();
          +-----------------+
          | version() |
          +-----------------+
          | 10.1.10-MariaDB |
          +-----------------+
          1 row in set (0.00 sec)

          Recreate:
          =====
          select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));

          Problem:
          ========
          (1,null) not in ((2,2),(3,3)) is expected to return true.
          elenst Elena Stepanova made changes -
          Description Output:
          ======
          mysql> select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));
          +-------------------------------+-------------------------+-------------------------+
          | (1,null) not in ((2,2),(3,3)) | (1,null) not in ((2,2)) | (1,null) not in ((3,3)) |
          +-------------------------------+-------------------------+-------------------------+
          | NULL | 1 | 1 |
          +-------------------------------+-------------------------+-------------------------+
          1 row in set (0.00 sec)

          mysql> select version();
          +-----------------+
          | version() |
          +-----------------+
          | 10.1.10-MariaDB |
          +-----------------+
          1 row in set (0.00 sec)

          Recreate:
          =====
          select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));

          Problem:
          ========
          (1,null) not in ((2,2),(3,3)) is expected to return true.
          Output:
          {noformat}
          mysql> select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));
          +-------------------------------+-------------------------+-------------------------+
          | (1,null) not in ((2,2),(3,3)) | (1,null) not in ((2,2)) | (1,null) not in ((3,3)) |
          +-------------------------------+-------------------------+-------------------------+
          | NULL | 1 | 1 |
          +-------------------------------+-------------------------+-------------------------+
          1 row in set (0.00 sec)

          mysql> select version();
          +-----------------+
          | version() |
          +-----------------+
          | 10.1.10-MariaDB |
          +-----------------+
          1 row in set (0.00 sec)
          {noformat}

          Recreate:
          {noformat}
          select (1,null) not in ((2,2),(3,3)), (1,null) not in ((2,2)), (1,null) not in ((3,3));
          {noformat}

          Problem:
          ========
          {{(1,null) not in ((2,2),(3,3))}} is expected to return true.
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 5.5 [ 15800 ]
          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 ]
          Affects Version/s 10.1.10 [ 20402 ]
          Assignee Alexander Barkov [ bar ]
          Labels upstream-fixed
          Priority Critical [ 2 ] Major [ 3 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Sprint 5.5.48-0 [ 33 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Rank Ranked higher
          bar Alexander Barkov made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          bar Alexander Barkov made changes -
          Assignee Alexander Barkov [ bar ] Sergei Golubchik [ serg ]
          Status In Progress [ 3 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Sprint 5.5.48-0 [ 33 ] 5.5.48-0, 10.1.13 [ 33, 42 ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Alexander Barkov [ bar ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          bar Alexander Barkov made changes -
          Fix Version/s 10.1.13 [ 21803 ]
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 73500 ] MariaDB v4 [ 149972 ]

          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.