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

InnoDB NOT IN Query Crash When One Item Is NULL

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

            Transition Time In Source Status Execution Times
            Elena Stepanova made transition -
            Open Confirmed
            5d 11h 36m 1
            Alexander Barkov made transition -
            Confirmed In Progress
            38d 23h 22m 1
            Alexander Barkov made transition -
            In Progress In Review
            2d 19h 36m 1
            Sergei Golubchik made transition -
            In Review Stalled
            3h 58m 1
            Alexander Barkov made transition -
            Stalled Closed
            42m 44s 1

            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.