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

Assertion `0' failed in row_sel_convert_mysql_key_to_innobase upon UPDATE using a partial-field key prefix in search

    XMLWordPrintable

Details

    Description

      Note: There have been numerous bug reports with the same assertion failure, but they are all closed as fixed by now: MDEV-16240, MDEV-19677, MDEV-19634, MDEV-18793.

      --source include/have_innodb.inc
       
      CREATE  TABLE t1 (f VARCHAR(256) NOT NULL, KEY(f)) ENGINE=InnoDB;
      ALTER IGNORE TABLE t1 MODIFY COLUMN f VARCHAR(4096) NOT NULL;
      INSERT INTO t1 VALUES ('a'),('b'); # Optional, fails either way
      UPDATE t1 SET f = 'foo' WHERE f < 'bar';
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 3cc0e0be

      2019-12-07 15:13:32 140488604239616 [Warning] InnoDB: Using a partial-field key prefix in search, index `f` of table `test`.`t1`. Last data field length 4098 bytes, key ptr now exceeds key end by 1024 bytes. Key value in the MySQL format:
       len 3074; hex 0300626172000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000; asc   bar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ;
      mysqld: /data/src/10.2/storage/innobase/row/row0sel.cc:2738: void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint, trx_t*): Assertion `0' failed.
      191207 15:13:32 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc612f4ef12 in __GI___assert_fail (assertion=0x5621ea3954d3 "0", file=0x5621ea395160 "/data/src/10.2/storage/innobase/row/row0sel.cc", line=2738, function=0x5621ea398e60 <row_sel_convert_mysql_key_to_innobase(dtuple_t*, unsigned char*, unsigned long, dict_index_t*, unsigned char const*, unsigned long, trx_t*)::__PRETTY_FUNCTION__> "void row_sel_convert_mysql_key_to_innobase(dtuple_t*, byte*, ulint, dict_index_t*, const byte*, ulint, trx_t*)") at assert.c:101
      #8  0x00005621e9d6aaa8 in row_sel_convert_mysql_key_to_innobase (tuple=0x7fc5b8185958, buf=0x0, buf_len=0, index=0x7fc5b8183488, key_ptr=0x7fc5b803cd5a '\217' <repeats 200 times>..., key_len=3074, trx=0x7fc60e161140) at /data/src/10.2/storage/innobase/row/row0sel.cc:2738
      #9  0x00005621e9c05c07 in ha_innobase::records_in_range (this=0x7fc5b8186e88, keynr=0, min_key=0x0, max_key=0x7fc60d599010) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:14027
      #10 0x00005621e9904b1d in handler::multi_range_read_info_const (this=0x7fc5b8186e88, keyno=0, seq=0x7fc60d5991a0, seq_init_param=0x7fc60d5991d0, n_ranges_arg=0, bufsz=0x7fc60d599094, flags=0x7fc60d599090, cost=0x7fc60d5997d0) at /data/src/10.2/sql/multi_range_read.cc:107
      #11 0x00005621e9907de2 in DsMrr_impl::dsmrr_info_const (this=0x7fc5b81872b8, keyno=0, seq=0x7fc60d5991a0, seq_init_param=0x7fc60d5991d0, n_ranges=0, bufsz=0x7fc60d599760, flags=0x7fc60d59975c, cost=0x7fc60d5997d0) at /data/src/10.2/sql/multi_range_read.cc:1470
      #12 0x00005621e9c12728 in ha_innobase::multi_range_read_info_const (this=0x7fc5b8186e88, keyno=0, seq=0x7fc60d5991a0, seq_init_param=0x7fc60d5991d0, n_ranges=0, bufsz=0x7fc60d599760, flags=0x7fc60d59975c, cost=0x7fc60d5997d0) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:21613
      #13 0x00005621e9b44ee2 in check_quick_select (param=0x7fc60d599980, idx=0, index_only=false, tree=0x7fc5b80859e8, update_tbl_stats=true, mrr_flags=0x7fc60d59975c, bufsize=0x7fc60d599760, cost=0x7fc60d5997d0) at /data/src/10.2/sql/opt_range.cc:10386
      #14 0x00005621e9b3c86d in get_key_scans_params (param=0x7fc60d599980, tree=0x7fc5b8085968, index_read_must_be_used=false, update_tbl_stats=true, read_time=3.5) at /data/src/10.2/sql/opt_range.cc:6823
      #15 0x00005621e9b32fdf in SQL_SELECT::test_quick_select (this=0x7fc5b8013270, thd=0x7fc5b8000af0, keys_to_use=..., prev_tables=0, limit=18446744073709551615, force_quick_range=false, ordered_output=false, remove_false_parts_of_where=false) at /data/src/10.2/sql/opt_range.cc:2594
      #16 0x00005621e98604e6 in SQL_SELECT::check_quick (this=0x7fc5b8013270, thd=0x7fc5b8000af0, force_quick_range=false, limit=18446744073709551615) at /data/src/10.2/sql/opt_range.h:1622
      #17 0x00005621e98594fb in mysql_update (thd=0x7fc5b8000af0, table_list=0x7fc5b8012550, fields=..., values=..., conds=0x7fc5b8012ef0, order_num=0, order=0x0, limit=18446744073709551615, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7fc60d59a870, updated_return=0x7fc60d59a920) at /data/src/10.2/sql/sql_update.cc:431
      #18 0x00005621e976ab65 in mysql_execute_command (thd=0x7fc5b8000af0) at /data/src/10.2/sql/sql_parse.cc:4014
      #19 0x00005621e97769d4 in mysql_parse (thd=0x7fc5b8000af0, rawbuf=0x7fc5b8012458 "UPDATE t1 SET f = 'foo' WHERE f < 'bar'", length=39, parser_state=0x7fc60d59b200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7740
      #20 0x00005621e9764cef in dispatch_command (command=COM_QUERY, thd=0x7fc5b8000af0, packet=0x7fc5b8096361 "UPDATE t1 SET f = 'foo' WHERE f < 'bar'", packet_length=39, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831
      #21 0x00005621e9763643 in do_command (thd=0x7fc5b8000af0) at /data/src/10.2/sql/sql_parse.cc:1384
      #22 0x00005621e98b8d0b in do_handle_one_connection (connect=0x5621ec1971e0) at /data/src/10.2/sql/sql_connect.cc:1336
      #23 0x00005621e98b8a76 in handle_one_connection (arg=0x5621ec1971e0) at /data/src/10.2/sql/sql_connect.cc:1241
      #24 0x00005621ea0eb07e in pfs_spawn_thread (arg=0x5621ec1ba490) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #25 0x00007fc614ac44a4 in start_thread (arg=0x7fc60d59c700) at pthread_create.c:456
      #26 0x00007fc61300bd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible with 10.2-10.5.
      Not reproducible with 10.1.
      No obvious problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.