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

InnoDB NOT IN Query Crash When One Item Is NULL

    XMLWordPrintable

Details

    • 10.0.26

    Description

      I understand this is generally a malformed query and a rather esoteric set of circumstances, but it was identified by accident by one of our developers.

      Scenario: If an InnoDB column is indexed, and the query has a NOT IN with more than two parameters, one of which is "null", the database crashes. If the index isn't there, the database does not crash. If the table is not InnoDB, the database does not crash.

      Test Case (verified on both 10.0.19 and 10.0.25 for Centos 6 x86_64 in both our development and production environments):

      create table crash
      (col_a int(11),
       col_b varchar(10),
       key (col_b))
       engine=innodb;
      

      – Does not crash

      select *
      from crash
      where col_b not in (null);
      

      – Does not crash

      select *
      from crash
      where col_b not in (null, '');
      

      – Does not crash

      select * 
      from crash
      where col_b not in ('', '0');
      

      – Crash

      select *
      from crash
      where col_b not in (null, '', 'A');
      

      – Crash

      select *
      from crash
      where col_b not in (null, '', '0');
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bmoore29 Bryce Moore
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.