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

Wrong result with DISTINCT and indexes

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
    • 10.5, 10.6, 10.11, 11.4
    • None

    Description

      Possibly the same as MDEV-27443 but no nopad collations here. Need to clean up and then look.

      --source include/have_innodb.inc
       
      DROP /* QNO 89 CON_ID 4 */ TABLE /*! IF EXISTS */ t7;
      CREATE /* QNO 90 CON_ID 4 */ TABLE t7 (col_char BINARY(177) NULL, id BIGINT, col_varchar VARCHAR(912) NULL, col_time TIME(4) NOT NULL DEFAULT '00:00:00', col_int MEDIUMINT(14) NOT NULL DEFAULT 0) ENGINE=InnoDB;
      ALTER /* QNO 93 CON_ID 4 */ TABLE t7 ADD INDEX(col_char ASC,col_int DESC,col_varchar DESC,id DESC,col_time);
      ALTER /* QNO 95 CON_ID 4 */ TABLE t7 ADD INDEX(id,col_int);
      ALTER /* QNO 96 CON_ID 4 */ TABLE t7 ADD INDEX(col_char(64) ASC,col_varchar(64),id ASC);
      INSERT /* QNO 99 CON_ID 4 */ IGNORE INTO t7 (col_char,col_int,col_time,col_varchar,id) VALUES ('vd',8,'06:05:06.051444','',4);
       
      SELECT DISTINCT * FROM `t7` WHERE ( `col_int` IN ( 0, 2 ) OR `col_int` IS NOT NULL ) AND ( ( `id` <= 255 ) AND ( `id` < 9 ) ) OR ( `col_varchar` IS NULL OR ( `col_char` > 'e' ) ) AND ( ( `id` IS NULL OR `id` IN ( -117, 7 ) ) );
      

      The query returns an empty result set while it should return the row.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.