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

Wrong result of SELECT query while two indexed colums are in WHERE section

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3.12, 5.5.36, 10.0.9
    • Fix Version/s: 5.5.37, 10.0.10
    • Component/s: None
    • Labels:
    • Environment:
      Centos 6.5 64bit base install

      Description

      Problem occurs on test table, which consists of two indexed comlumns and primary key column. With following query:

      SELECT count(*)
      FROM `test`
      WHERE `col2` = '636146' AND `col1` = '7+';

      result: 0

      Same query while running after:

      SET optimizer_switch='index_merge=off';

      result: 73

      I attach my test database, which is derived from production database where issue occurs. I was able to reproduce problem on several other systems.

      I was unable to reproduce same error on MySQL 5.5.35

      Issue might be related to "intersect(col1,col2);" in query EXPLAIN, while any modification of query (eg. adding OR condition to WHERE expression) seems to avoid the issue. Deleting primary key (which is not involved in query), changing table to MyISAM seems to cause correct behavior of system.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psergey Sergei Petrunia
              Reporter:
              benas Vojtech Benes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: