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

LP:919427 - Assertion abort on the EXPLAIN for a query containing a simple IN subquery

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      The following test case (a modification of the test case for bug #12838171 from mysql-5.6 code line) causes an assertion abort in mariadb-5.2 on the assertion
      `!table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || bitmap_is_set(table->vcol_set, [field_index))'field.cc:7017]

      CREATE TABLE ot (
      col_int_nokey int(11),
      col_varchar_nokey varchar(1)
      ) ;
      INSERT INTO ot VALUES (1,'x');
      CREATE TABLE it1 (
      col_int_key int(11),
      col_varchar_key varchar(1),
      col_varchar_key2 varchar(1),
      KEY idx_cvk_cvk2_cik (col_varchar_key, col_varchar_key2, col_int_key),
      KEY idx_cvk_cik (col_varchar_key, col_int_key)
      );
      INSERT INTO it1 VALUES (NULL,'x','x'), (NULL,'f','f');

      EXPLAIN
      SELECT col_int_nokey FROM ot
      WHERE (col_varchar_nokey, 'x') IN
      (SELECT col_varchar_key, col_varchar_key2 FROM it1);

      The following EXPLAIN

      EXPLAIN
      SELECT col_int_nokey FROM ot
      WHERE col_varchar_nokey IN
      (SELECT col_varchar_key FROM it2 WHERE col_int_key IS NULL);

      that uses table it2

      CREATE TABLE it2(
      col_int_key int(11),
      col_varchar_key varchar(1),
      KEY idx_cvk_cik (col_varchar_key,col_int_key)
      ) ;
      INSERT INTO it2 VALUES (NULL,'x'), (NULL,'f');

      erroneously returns
      "Impossible WHERE noticed after reading const tables".

      Attachments

        Activity

          People

            igor Igor Babaev
            igor Igor Babaev
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.