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

Assertion `!mbmaxlen || !(prefix_len % mbmaxlen)' failed in dtype_get_at_most_n_mbchars

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (f TEXT) WITH SYSTEM VERSIONING CHARACTER SET utf8 ENGINE=InnoDB;
      INSERT INTO t VALUES ('foo');
      DELETE FROM t;
      ALTER TABLE t ADD FULLTEXT (f);
       
      # Cleanup
      DROP TABLE t;
      

      10.3 7a98d232

      /src/storage/innobase/data/data0type.cc:63: ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*): Assertion `!mbmaxlen || !(prefix_len % mbmaxlen)' failed
       
      #7  0x00007f3e7237b662 in __GI___assert_fail (assertion=0x564011d04300 "!mbmaxlen || !(prefix_len % mbmaxlen)", file=0x564011d04240 "/src/storage/innobase/data/data0type.cc", line=63, function=0x564011d04360 "ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*)") at assert.c:101
      #8  0x0000564010d00461 in dtype_get_at_most_n_mbchars (prtype=2212092, mbminlen=1, mbmaxlen=3, prefix_len=1, data_len=3, str=0x7f3e683ec092 "fooc\331T{\bwUc\331T{\b}\277") at /src/storage/innobase/data/data0type.cc:63
      #9  0x000056401099bdda in row_merge_buf_add (buf=0x615000044d08, fts_index=0x618000049d08, old_table=0x6190000d4e08, new_table=0x6190000d9408, psort_info=0x6190000e5b80, row=0x63100008c8b8, ext=0x0, history_fts=true, doc_id=0x7f3e5bb42b10, conv_heap=0x0, err=0x7f3e5bb42ab0, v_heap=0x7f3e5bb42af0, my_table=0x61f000043688, trx=0x7f3e687898b8) at /src/storage/innobase/row/row0merge.cc:725
      #10 0x00005640109a8515 in row_merge_read_clustered_index (trx=0x7f3e687898b8, table=0x61f000043688, old_table=0x6190000d4e08, new_table=0x6190000d9408, online=false, index=0x6190000d91b0, fts_sort_idx=0x618000055908, psort_info=0x6190000e5b80, files=0x60800000c2a0, key_numbers=0x6190000d91d0, n_index=3, defaults=0x0, add_v=0x0, col_map=0x61d0001f9108, add_autoinc=18446744073709551615, sequence=..., block=0x7f3e5b5e5000 "", skip_pk_sort=true, tmpfd=0x7f3e5bb43920, stage=0x60700001cd40, pct_cost=25, crypt_block=0x0, eval_table=0x61f000043688, allow_not_null=false) at /src/storage/innobase/row/row0merge.cc:2329
      #11 0x00005640109b854d in row_merge_build_indexes (trx=0x7f3e687898b8, old_table=0x6190000d4e08, new_table=0x6190000d9408, online=false, indexes=0x6190000d91b0, key_numbers=0x6190000d91d0, n_indexes=3, table=0x61f000043688, defaults=0x0, col_map=0x61d0001f9108, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=true, stage=0x60700001cd40, add_v=0x0, eval_table=0x61f000043688, allow_not_null=false) at /src/storage/innobase/row/row0merge.cc:4707
      #12 0x000056401074d9bf in ha_innobase::inplace_alter_table (this=0x61c0000610a8, altered_table=0x61f000043688, ha_alter_info=0x7f3e5bb44df0) at /src/storage/innobase/handler/handler0alter.cc:7241
      #13 0x000056400fc34e82 in handler::ha_inplace_alter_table (this=0x61c0000610a8, altered_table=0x61f000043688, ha_alter_info=0x7f3e5bb44df0) at /src/sql/handler.h:4153
      #14 0x000056400fc17c08 in mysql_inplace_alter_table (thd=0x62a0000ba208, table_list=0x62b000000338, table=0x61f000042888, altered_table=0x61f000043688, ha_alter_info=0x7f3e5bb44df0, target_mdl_request=0x7f3e5bb44fd0, alter_ctx=0x7f3e5bb45830) at /src/sql/sql_table.cc:7778
      #15 0x000056400fc29141 in mysql_alter_table (thd=0x62a0000ba208, new_db=0x62a0000be918, new_name=0x62a0000bed00, create_info=0x7f3e5bb46550, table_list=0x62b000000338, alter_info=0x7f3e5bb46450, order_num=0, order=0x0, ignore=false) at /src/sql/sql_table.cc:10166
      #16 0x000056400fd9287c in Sql_cmd_alter_table::execute (this=0x62b000000ac8, thd=0x62a0000ba208) at /src/sql/sql_alter.cc:512
      #17 0x000056400f9de0bf in mysql_execute_command (thd=0x62a0000ba208) at /src/sql/sql_parse.cc:6076
      #18 0x000056400f9e9ef0 in mysql_parse (thd=0x62a0000ba208, rawbuf=0x62b000000228 "ALTER TABLE t ADD FULLTEXT (f)", length=30, parser_state=0x7f3e5bb48950, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:7855
      #19 0x000056400f9c1580 in dispatch_command (command=COM_QUERY, thd=0x62a0000ba208, packet=0x629000136209 "ALTER TABLE t ADD FULLTEXT (f)", packet_length=30, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:1852
      #20 0x000056400f9be138 in do_command (thd=0x62a0000ba208) at /src/sql/sql_parse.cc:1398
      #21 0x000056400fd82166 in do_handle_one_connection (connect=0x608000000ea8) at /src/sql/sql_connect.cc:1404
      #22 0x000056400fd81a62 in handle_one_connection (arg=0x608000000ea8) at /src/sql/sql_connect.cc:1309
      #23 0x0000564011333775 in pfs_spawn_thread (arg=0x615000007608) at /src/storage/perfschema/pfs.cc:1869
      #24 0x00007f3e72526ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #25 0x00007f3e72446aef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure started happening on 10.3 after this commit:

      commit e056efdd6cfa62cc4c978fce5730af0b8d4c3c6b
      Author: Aleksey Midenkov
      Date:   Tue Dec 27 00:02:02 2022 +0300
       
          MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY
      

      On higher versions the assertion is a bit different. The test case is the same.

      10.11

      ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*): Assertion `!mbmaxlen || !(prefix_len % mbmaxlen) || !(prefix_len % 4)' failed
      

      Non-debug builds also fail, with a non-debug version of the assertion

      10.3 f812f8e1

      2023-01-31 20:16:07 0x7f91e3287700  InnoDB: Assertion failure in file /data/src/10.3/storage/innobase/data/data0type.cc line 66
      InnoDB: Failing assertion: !(prefix_len % mbmaxlen)
      

      Attachments

        Issue Links

          Activity

            People

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