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

Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' fails on EXPLAIN EXTENDED with VALUES function

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.3.12, 5.5.34, 10.0.6
    • 5.5.37, 10.0.10, 5.3.13
    • None
    • None

    Description

      Setting to minor because it's a debug assertion, constant table and a rather meaningless use of VALUES function.

      CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1,10);
      CREATE VIEW v1 AS SELECT * FROM t1;
       
      EXPLAIN EXTENDED SELECT VALUES(b) FROM v1;

      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.
      131214  3:03:08 [ERROR] mysqld got signal 6 ;

      #6  0x00007fbbc958a621 in *__GI___assert_fail (assertion=0xcb8a70 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=<optimized out>, line=3675, function=0xcbbd60 "virtual String* Field_long::val_str(String*, String*)") at assert.c:81
      #7  0x000000000065e128 in Field_long::val_str (this=0x21dfa30, val_buffer=0x7fbbc0aa6410, val_ptr=0x21b84e0) at field.cc:3675
      #8  0x00000000005a5aa4 in Item_field::val_str (this=0x21b84c8, str=0x7fbbc0aa6410) at item.cc:2384
      #9  0x00000000005a0b6f in Item::print_value (this=0x21b84c8, str=0x7fbbc0aa68c0) at item.cc:585
      #10 0x00000000005afc1c in Item_field::print (this=0x21b84c8, str=0x7fbbc0aa68c0, query_type=QT_ORDINARY) at item.cc:6209
      #11 0x00000000005b49b9 in Item_insert_value::print (this=0x21b6ad0, str=0x7fbbc0aa68c0, query_type=QT_ORDINARY) at item.cc:7897
      #12 0x00000000005a0aa3 in Item::print_item_w_name (this=0x21b6ad0, str=0x7fbbc0aa68c0, query_type=QT_ORDINARY) at item.cc:570
      #13 0x0000000000761ac9 in st_select_lex::print (this=0x2135660, thd=0x2132bc8, str=0x7fbbc0aa68c0, query_type=QT_ORDINARY) at sql_select.cc:22700
      #14 0x0000000000587ea6 in st_select_lex_unit::print (this=0x2135158, str=0x7fbbc0aa68c0, query_type=QT_ORDINARY) at sql_lex.cc:2106
      #15 0x00000000006b4c95 in execute_sqlcom_select (thd=0x2132bc8, all_tables=0x21b6c40) at sql_parse.cc:5157
      #16 0x00000000006abf50 in mysql_execute_command (thd=0x2132bc8) at sql_parse.cc:2305
      #17 0x00000000006b771b in mysql_parse (thd=0x2132bc8, rawbuf=0x21b6900 "EXPLAIN EXTENDED SELECT VALUES(b) FROM v1", length=41, found_semicolon=0x7fbbc0aa7cb8) at sql_parse.cc:6173
      #18 0x00000000006a9730 in dispatch_command (command=COM_QUERY, thd=0x2132bc8, packet=0x21ad499 "", packet_length=41) at sql_parse.cc:1243
      #19 0x00000000006a8a1c in do_command (thd=0x2132bc8) at sql_parse.cc:923
      #20 0x00000000006a58a5 in handle_one_connection (arg=0x2132bc8) at sql_connect.cc:1231
      #21 0x00007fbbca296b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #22 0x00007fbbc9639a7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: igor@askmonty.org-20131212215533-9n040xfc9onhho5o
      revno: 3736
      branch-nick: 5.3

      Attachments

        Activity

          Raising the priority because it might affect other EXPLAIN EXTENDED queries, not just those with VALUES(..), and minor issues don't even get analyzed.

          elenst Elena Stepanova added a comment - Raising the priority because it might affect other EXPLAIN EXTENDED queries, not just those with VALUES(..), and minor issues don't even get analyzed.

          In the SELECT list we see Field object which do not belong to table in refer (probably it is a copy) with wrong field_index.

          sanja Oleksandr Byelkin added a comment - In the SELECT list we see Field object which do not belong to table in refer (probably it is a copy) with wrong field_index.

          The problem is in Item_insert_value::fix_fields trick by creating null field.

          sanja Oleksandr Byelkin added a comment - The problem is in Item_insert_value::fix_fields trick by creating null field.

          The patch send for review.

          sanja Oleksandr Byelkin added a comment - The patch send for review.

          People

            sanja Oleksandr Byelkin
            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.