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

Assertion `(templ->is_virtual && !field) || (field && field->prefix_len ? field->prefix_len == len : templ->mysql_col_len == len)' failed row_sel_field_store_in_mysql_format_func

    XMLWordPrintable

    Details

      Description

      Note: I'm filing it for 10.4 because it's the only version I can reproduce it with; but the failure depends on the execution plan. I can get rid of the failure by setting rowid_filter=off in optimizer_switch on 10.4, but I can't do the reverse on 10.3, so I have no information whether the problem exists in previous version.

      Note: Run with --repeat=N. The test case appears deterministic, but the failure is still sporadic. It usually fails for me withing first 1-2 attempts, but it can vary on different machines and builds.

      --source include/have_innodb.inc
       
      SET @stats.save= @@innodb_stats_persistent;
      SET GLOBAL innodb_stats_persistent= ON;
       
      CREATE TABLE t1 ( 
        a CHAR(100),
        pk INTEGER AUTO_INCREMENT,
        b BIT(8),
        c CHAR(115) AS (a) VIRTUAL,
        PRIMARY KEY(pk),
        KEY(c),
        KEY(b)
      ) ENGINE=InnoDB;
      INSERT INTO t1 (a,b) VALUES ('foo',b'0'),('',NULL),(NULL,b'1');
       
      CREATE TABLE t2 (f CHAR(100)) ENGINE=InnoDB;
       
      SELECT t1a.* FROM t1 AS t1a JOIN t1 AS t1b LEFT JOIN t2  ON (f = t1b.a) WHERE t1a.b >= 0 AND t1a.c = t1b.a;
       
      # Cleanup
      DROP TABLE t1, t2;
      SET GLOBAL innodb_stats_persistent= @stats.save;
      

      10.4 6d68a346

      mysqld: /data/src/10.4/storage/innobase/row/row0sel.cc:2854: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `(templ->is_virtual && !field) || (field && field->prefix_len ? field->prefix_len == len : templ->mysql_col_len == len)' failed.
      190313 15:11:45 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fb2b35aeee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000564f5f0195f8 in row_sel_field_store_in_mysql_format_func (dest=0x7fb2641a1241 ' ' <repeats 100 times>, "\003", templ=0x7fb26406cac0, index=0x7fb26414feb8, field_no=1, data=0x7fb2ad0a40f1 "\200", len=4) at /data/src/10.4/storage/innobase/row/row0sel.cc:2851
      #9  0x0000564f5f019d14 in row_sel_store_mysql_field (mysql_rec=0x7fb2641a1240 "\373", ' ' <repeats 100 times>, "\003", prebuilt=0x7fb264152508, rec=0x7fb2ad0a407e "foo", ' ' <repeats 112 times>, "\200", index=0x7fb26414feb8, offsets=0x7fb2ac8d5220, field_no=1, templ=0x7fb26406cac0) at /data/src/10.4/storage/innobase/row/row0sel.cc:3006
      #10 0x0000564f5f01bdab in row_search_idx_cond_check (mysql_rec=0x7fb2641a1240 "\373", ' ' <repeats 100 times>, "\003", prebuilt=0x7fb264152508, rec=0x7fb2ad0a407e "foo", ' ' <repeats 112 times>, "\200", offsets=0x7fb2ac8d5220) at /data/src/10.4/storage/innobase/row/row0sel.cc:3888
      #11 0x0000564f5f01f6a9 in row_search_mvcc (buf=0x7fb2641a1240 "\373", ' ' <repeats 100 times>, "\003", mode=PAGE_CUR_GE, prebuilt=0x7fb264152508, match_mode=1, direction=0) at /data/src/10.4/storage/innobase/row/row0sel.cc:5205
      #12 0x0000564f5ee7d7f1 in ha_innobase::index_read (this=0x7fb264151518, buf=0x7fb2641a1240 "\373", ' ' <repeats 100 times>, "\003", key_ptr=0x7fb26407ca70 "", key_len=116, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9360
      #13 0x0000564f5eb4b404 in handler::index_read_map (this=0x7fb264151518, buf=0x7fb2641a1240 "\373", ' ' <repeats 100 times>, "\003", key=0x7fb26407ca70 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/handler.h:3594
      #14 0x0000564f5eb3d2b7 in handler::ha_index_read_map (this=0x7fb264151518, buf=0x7fb2641a1240 "\373", ' ' <repeats 100 times>, "\003", key=0x7fb26407ca70 "", keypart_map=1, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/handler.cc:3040
      #15 0x0000564f5e86d891 in join_read_always_key (tab=0x7fb26407bf18) at /data/src/10.4/sql/sql_select.cc:20776
      #16 0x0000564f5e86bd5d in sub_select (join=0x7fb264019718, join_tab=0x7fb26407bf18, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20015
      #17 0x0000564f5e86c4cb in evaluate_join_record (join=0x7fb264019718, join_tab=0x7fb26407bb50, error=0) at /data/src/10.4/sql/sql_select.cc:20238
      #18 0x0000564f5e86bdbf in sub_select (join=0x7fb264019718, join_tab=0x7fb26407bb50, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20018
      #19 0x0000564f5e86b2ed in do_select (join=0x7fb264019718, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:19556
      #20 0x0000564f5e841da9 in JOIN::exec_inner (this=0x7fb264019718) at /data/src/10.4/sql/sql_select.cc:4371
      #21 0x0000564f5e840f50 in JOIN::exec (this=0x7fb264019718) at /data/src/10.4/sql/sql_select.cc:4153
      #22 0x0000564f5e842602 in mysql_select (thd=0x7fb264000b00, tables=0x7fb264015bd8, wild_num=1, fields=..., conds=0x7fb264018c60, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fb2640196f0, unit=0x7fb264004a28, select_lex=0x7fb264015608) at /data/src/10.4/sql/sql_select.cc:4585
      #23 0x0000564f5e832b7a in handle_select (thd=0x7fb264000b00, lex=0x7fb264004960, result=0x7fb2640196f0, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:424
      #24 0x0000564f5e7fbf4b in execute_sqlcom_select (thd=0x7fb264000b00, all_tables=0x7fb264015bd8) at /data/src/10.4/sql/sql_parse.cc:6651
      #25 0x0000564f5e7f1206 in mysql_execute_command (thd=0x7fb264000b00) at /data/src/10.4/sql/sql_parse.cc:3888
      #26 0x0000564f5e7ffe8b in mysql_parse (thd=0x7fb264000b00, rawbuf=0x7fb2640154c8 "SELECT t1a.* FROM t1 AS t1a JOIN t1 AS t1b LEFT JOIN t2  ON (f = t1b.a) WHERE t1a.b >= 0 AND t1a.c = t1b.a", length=106, parser_state=0x7fb2ac8d7180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8204
      #27 0x0000564f5e7eb4cd in dispatch_command (command=COM_QUERY, thd=0x7fb264000b00, packet=0x7fb264139ff1 "", packet_length=106, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1829
      #28 0x0000564f5e7e9cb3 in do_command (thd=0x7fb264000b00) at /data/src/10.4/sql/sql_parse.cc:1358
      #29 0x0000564f5e9639e5 in do_handle_one_connection (connect=0x564f61f954f0) at /data/src/10.4/sql/sql_connect.cc:1399
      #30 0x0000564f5e963756 in handle_one_connection (arg=0x564f61f954f0) at /data/src/10.4/sql/sql_connect.cc:1302
      #31 0x0000564f5ee59253 in pfs_spawn_thread (arg=0x564f61fdb360) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #32 0x00007fb2b5285494 in start_thread (arg=0x7fb2ac8d8700) at pthread_create.c:333
      #33 0x00007fb2b366b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nikitamalyavin Nikita Malyavin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration

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