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

Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' fails on EXPLAIN EXTENDED with merge view or select SQ, constant table, ORDER BY

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • None
    • 5.5.34, 10.0.7, 5.3.13
    • None
    • None

    Description

      The problem appeared on 5.3 tree with the following revision:

      revno: 3721 [merge]
      revision-id: igor@askmonty.org-20131113233112-nhm665c8kvmfmv0r
      parent: bar@mnogosearch.org-20131113143412-nnf6q8io4mba06ym
      parent: igor@askmonty.org-20131113224309-zu9s5acndpa8f1mf
      committer: Igor Babaev <igor@askmonty.org>
      branch nick: maria-5.3
      timestamp: Wed 2013-11-13 15:31:12 -0800
      message:
        Merge
          ------------------------------------------------------------
          revno: 3717.1.1
          revision-id: igor@askmonty.org-20131113224309-zu9s5acndpa8f1mf
          parent: sergii@pisem.net-20131112140225-77do23f20x8n45g3
          committer: Igor Babaev <igor@askmonty.org>
          branch nick: maria-5.3-mdev5091
          timestamp: Wed 2013-11-13 14:43:09 -0800
          message:
            Fixed bug mdev-5091.
            The function SELECT_LEX::update_used_tables should process all
            ORDER BY lists in any subselect of a union.

      mysqld: field.cc:3675: virtual String* Field_long::val_str(String*, String*): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
      131114 13:51:09 [ERROR] mysqld got signal 6 ;

      #6  0x00007f88641ac0ee in __assert_fail_base (fmt=<optimized out>, assertion=0xcb3c30 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=0xcb3b4f "field.cc", line=<optimized out>, function=<optimized out>) at assert.c:94
      #7  0x00007f88641ac192 in __GI___assert_fail (assertion=0xcb3c30 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=0xcb3b4f "field.cc", line=3675, function=0xcb6940 "virtual String* Field_long::val_str(String*, String*)") at assert.c:103
      #8  0x000000000063b68c in Field_long::val_str (this=0x7f884802e090, val_buffer=0x7f886302e320, val_ptr=0x7f88480364f8) at field.cc:3675
      #9  0x00000000005825f5 in Item_field::val_str (this=0x7f88480364e0, str=0x7f886302e320) at item.cc:2363
      #10 0x000000000057d596 in Item::print_value (this=0x7f88480364e0, str=0x7f886302e820) at item.cc:564
      #11 0x000000000058c82c in Item_field::print (this=0x7f88480364e0, str=0x7f886302e820, query_type=QT_ORDINARY) at item.cc:6188
      #12 0x000000000058dcfd in Item_ref::print (this=0x7f8848038268, str=0x7f886302e820, query_type=QT_ORDINARY) at item.cc:6695
      #13 0x00000000005640c9 in st_select_lex::print_order (str=0x7f886302e820, order=0x7f88480199a8, query_type=QT_ORDINARY) at sql_lex.cc:2155
      #14 0x0000000000742cae in st_select_lex::print (this=0x3ac6360, thd=0x3ac38c8, str=0x7f886302e820, query_type=QT_ORDINARY) at sql_select.cc:22714
      #15 0x0000000000563e4e in st_select_lex_unit::print (this=0x3ac5e58, str=0x7f886302e820, query_type=QT_ORDINARY) at sql_lex.cc:2106
      #16 0x0000000000693538 in execute_sqlcom_select (thd=0x3ac38c8, all_tables=0x7f8848019180) at sql_parse.cc:5157
      #17 0x000000000068a446 in mysql_execute_command (thd=0x3ac38c8) at sql_parse.cc:2305
      #18 0x0000000000696108 in mysql_parse (thd=0x3ac38c8, rawbuf=0x7f8848018f40 "EXPLAIN EXTENDED SELECT a FROM v1 WHERE a > 100 ORDER BY b", length=58, found_semicolon=0x7f886302f7e0) at sql_parse.cc:6173
      #19 0x0000000000687b63 in dispatch_command (command=COM_QUERY, thd=0x3ac38c8, packet=0x3b3db29 "", packet_length=58) at sql_parse.cc:1243
      #20 0x0000000000686dd4 in do_command (thd=0x3ac38c8) at sql_parse.cc:923
      #21 0x0000000000683c6e in handle_one_connection (arg=0x3ac38c8) at sql_connect.cc:1231
      #22 0x00007f8864d47e9a in start_thread (arg=0x7f8863030700) at pthread_create.c:308
      #23 0x00007f8864270cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Test case:

      CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (4,1);
       
      CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
      EXPLAIN EXTENDED SELECT a FROM v1 WHERE a > 100 ORDER BY b;

      Same happens with a subquery instead of the view.

      Attachments

        Activity

          People

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