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

Incorrect Join Execution When Controlling Outer Join Operations

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.8.2, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • 10.4, 10.5, 10.6
    • Optimizer
    • None

    Description

      CREATE TABLE `t1` (
      `c0` char(100) DEFAULT NULL,
      KEY `ic0` (`c0`)
      );
      INSERT INTO `t1` VALUES ('!n0-dZx*'),('1678835511'),('E'),('QZI');

      CREATE TABLE `t2` (
      `c0` varchar(100) DEFAULT NULL,
      `c1` char(100) DEFAULT NULL,
      UNIQUE KEY `c0` (`c0`)
      );
      INSERT INTO `t2` VALUES ('-145500836','\n'),('^U?N','');

      CREATE TABLE `t3` (
      `c0` char(100) NOT NULL,
      `c1` varchar(100) DEFAULT NULL,
      PRIMARY KEY (`c0`)
      );
      INSERT INTO `t3` VALUES ('','
      1idpE'),('-323326722','');

      mysql> SELECT t3.c0 FROM t1 CROSS JOIN t2 LEFT OUTER JOIN t3 ON t2.c1 = t3.c1 WHERE (t1.c0 IN ((t2.c0 REGEXP t2.c1), t2.c0));
      ------

      c0

      ------

      NULL
      NULL
      NULL

      ------
      3 rows in set, 6 warnings (0.00 sec)

      mysql> SET optimizer_switch='outer_join_with_cache=off';
      Query OK, 0 rows affected (0.00 sec)

      mysql> SELECT t3.c0 FROM t1 CROSS JOIN t2 LEFT OUTER JOIN t3 ON t2.c1 = t3.c1 WHERE (t1.c0 IN ((t2.c0 REGEXP t2.c1), t2.c0));
      ------------

      c0

      ------------

      NULL
      -323326722
      NULL
      NULL

      ------------
      4 rows in set, 6 warnings (0.01 sec)

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            sugar Xiu Tang
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.