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

INNER JOIN returns incorrect results

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.6.0, 12.1(EOL), 11.8
    • 10.6, 10.11, 11.4, 11.8
    • None
    • Ubuntu 20.04.4 LTS (x86)
      Kernel Version: 5.15.0-113-generic

    Description

      Description:
      When I use INNER JOIN to join two tables, I get the wrong result.

      How to repeat:

      CREATE TABLE t0(c0 TINYTEXT) ;
      CREATE TABLE t1 LIKE t0;
      CREATE INDEX i1 ON t0(c0(1) ASC);
      INSERT INTO t1(c0) VALUES(19), (6);
      INSERT INTO t0(c0) VALUES("㏫"), (61);
      INSERT INTO t0(c0) VALUES(29);
      INSERT INTO t0(c0) VALUES(99);
       
      SELECT * FROM t0; -- get [㏫,61,29,99]
      SELECT * FROM t1; -- get [19,6]
       
      SELECT ALL t1.c0 AS ref0 FROM t1 INNER JOIN t0 ON t1.c0 >= t0.c0; -- get[6,6], but expect [19,6,6]
      

      Suggested fix:
      The problem may lie in the optimization of INNER JOIN by storage engine InnoDB.

      Attachments

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              Chenglin Liang Chenglin Liang
              Votes:
              0 Vote for this issue
              Watchers:
              11 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.