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

WHERE ... IN ... incorrectly returns rows

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 12.1.2
    • N/A
    • Optimizer
    • None
    • 12.1.2-MariaDB-ubu2404
    • Not for Release Notes

    Description

      When using the IN predicate to compare a BINARY column with a BIT column returned from a subquery , the server returns incorrect results.

      How to repeat:

      CREATE TABLE t1(c1 BIT);
      CREATE TABLE t2(c1 BINARY(1));
       
      INSERT INTO t1(c1) VALUES(b'0'); 
      INSERT INTO t2(c1) VALUES('o');
      INSERT INTO t2(c1) VALUES('E');
       
      SELECT c1 FROM t2 WHERE t2.c1 IN (SELECT c1 FROM t1);
       
      /*
      ACTUAL RESULT (Incorrect):
      +------------+
      | c1         |
      +------------+
      | 0x6F       |
      | 0x45       |
      +------------+
      2 rows in set
       
      EXPECTED RESULT (Correct):
      Empty set (0 rows)
      */
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              March SerenMarch
              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.