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

A query involving STRAIGHT_JOIN and LIKE returns incorrect result

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 12.0.2, 12.1.2, 12.2.1
    • N/A
    • N/A
    • None
    • docker pull mariadb:latest
    • Not for Release Notes

    Description

      Hi, MariaDB developers:

      Thanks for reading my report.

      A query that uses INTERSECT between two mutually exclusive logical conditions returns a non-empty result set when STRAIGHT_JOIN and LIKE are used. The same logical construction returns the correct, empty set result in the latest version of MySQL (9.4.0).

      CREATE TABLE t0(c0 VARCHAR(2)) ;
      CREATE TABLE t1 LIKE t0;
      INSERT INTO t0(c0) VALUES('‪6'),(6);
      INSERT INTO t1(c0) VALUES(6);
       
      SELECT * FROM t1 STRAIGHT_JOIN t0 ON t1.c0 LIKE t0.c0 INTERSECT 
      SELECT * FROM t1 STRAIGHT_JOIN t0 ON t1.c0 NOT LIKE t0.c0; -- expect: empty set
      +------+------+
      | c0   | c0   |
      +------+------+
      | 6    | 6    |
      +------+------+
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jinhui lai jinhui lai
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.