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

disable_index_merge_plans causes SELECT data loss when more than 100 ORs

    XMLWordPrintable

Details

    Description

      Major regression introduced with index_merge optimization causes SELECT to lose data when used more than 100 OR conditions. See complete SQL in attachment.

      CREATE TABLE `index_merge_test` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `uniq2` smallint(6) NOT NULL DEFAULT 0,
        PRIMARY KEY (`id`),
        KEY `uniq2` (`uniq2`)
      ) ENGINE=MyISAM;
       
      INSERT INTO `index_merge_test` (`id`, `uniq2`) VALUES
      	(1, 1),
      	(2, 1),
      	(3, 2);
      

      SELECT id FROM index_merge_test WHERE
       -- (uniq2 = 2 AND id = 3) OR /* Try to uncomment this line. Expected number of results: 3. Returned number results: 1.  */
        (uniq2 = 1)
       OR (uniq2 = 1)
       OR (uniq2 = 1)
       OR (uniq2 = 1)
      -- (repeat 100x)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              machacekgonet Pavel Macháček
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.