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

Assertion `prefix_len % field->charset()->mbmaxlen == 0' failed in create_index

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 13.3
    • 13.3
    • JSON
    • Not for Release Notes
    • Q1/2027 Server Maintenance

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (j JSON, KEY (j(1))) ENGINE=INNODB CHARSET=latin1;
      

      Leads to

      MDEV-38740 CS 13.2.0 49efccb222e2370690b4de0416817fa35f9da2ea (Debug, Clang 18.1.3-11) Build 15/10/2026

      mariadbd: /test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc:11221: int create_index(trx_t *, const TABLE *, const ha_table_option_struct &, dict_table_t *, uint): Assertion `prefix_len % field->charset()->mbmaxlen == 0' failed.
      

      MDEV-38740 CS 13.2.0 49efccb222e2370690b4de0416817fa35f9da2ea (Debug, Clang 18.1.3-11) Build 15/10/2026

      Core was generated by `/test/mtest/MDEV-38740/MD151026-mariadb-13.2.0-linux-x86_64-dbg/bin/mariadbd --'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 609610)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000076c25984527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000076c2598288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000076c25982881b in __assert_fail_base (fmt=0x76c2599d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5e81273b5aef "prefix_len % field->charset()->mbmaxlen == 0", file=file@entry=0x5e81273ae375 "/test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc", line=line@entry=11221, function=function@entry=0x5e81273b5a19 "int create_index(trx_t *, const TABLE *, const ha_table_option_struct &, dict_table_t *, uint)")at ./assert/assert.c:96
      #6  0x000076c25983b517 in __assert_fail (assertion=0x5e81273b5aef "prefix_len % field->charset()->mbmaxlen == 0", file=0x5e81273ae375 "/test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc", line=11221, function=0x5e81273b5a19 "int create_index(trx_t *, const TABLE *, const ha_table_option_struct &, dict_table_t *, uint)") at ./assert/assert.c:105
      #7  0x00005e81269843f0 in create_index (trx=0x76c258ad3680, form=0x76c2580e5ce0, o=@0x6ec120029710: {page_compressed = false, page_compression_level = 0, atomic_writes = 2779096485, adaptive_hash_index = 0, encryption = 0, encryption_key_id = 1}, table=0x6ec12002cb78, key_num=0)at /test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc:11221
      #8  0x00005e812695ee3c in create_table_info_t::create_table (this=0x76c2580e5538, create_fk=true, strict=true)at /test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc:13158
      #9  0x00005e812694ab11 in ha_innobase::create (this=0x6ec12002ab40, name=0x76c2580e9730 "./test/t1", form=0x76c2580e5ce0, create_info=0x76c2580e9ea8, file_per_table=true, trx=0x76c258ad3680)at /test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc:13581
      #10 0x00005e8126960237 in ha_innobase::create (this=0x6ec12002ab40, name=0x76c2580e9730 "./test/t1", form=0x76c2580e5ce0, create_info=0x76c2580e9ea8)at /test/mtest/MDEV-38740/pr5263_dbg/storage/innobase/handler/ha_innodb.cc:13634
      #11 0x00005e812651e41f in handler::ha_create (this=0x6ec12002ab40, name=0x76c2580e9730 "./test/t1", form=0x76c2580e5ce0, info_arg=0x76c2580e9ea8)at /test/mtest/MDEV-38740/pr5263_dbg/sql/handler.cc:6322
      #12 0x00005e8126520630 in ha_create_table_from_share (thd=0x6ec120000d60, share=0x76c2580e7120, create_info=0x76c2580e9ea8, ref_length=0x76c2580e61b4)at /test/mtest/MDEV-38740/pr5263_dbg/sql/handler.cc:6782
      #13 0x00005e812651fe1d in ha_create_table (thd=0x6ec120000d60, path=0x76c2580e9730 "./test/t1", db=0x6ec12001a6f0 "test", table_name=0x6ec12001a6b0 "t1", create_info=0x76c2580e9ea8, frm=0x76c2580e96c0, skip_frm_file=false)at /test/mtest/MDEV-38740/pr5263_dbg/sql/handler.cc:6855
      #14 0x00005e81261c6560 in create_table_impl (thd=0x6ec120000d60, ddl_log_state_create=0x76c2580e9a98, ddl_log_state_rm=0x76c2580e9a78, orig_db=@0x6ec12001a730: {<Lex_ident_fs> = {<Lex_ident<Compare_table_names>> = {<Lex_cstring> = {<st_mysql_const_lex_string> = {str = 0x6ec12001a6f0 "test", length = 4}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, orig_table_name=@0x6ec12001a740: {<Lex_ident_fs> = {<Lex_ident<Compare_table_names>> = {<Lex_cstring> = {<st_mysql_const_lex_string> = {str = 0x6ec12001a6b0 "t1", length = 2}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, db=@0x6ec12001a730: {str = 0x6ec12001a6f0 "test", length = 4}, table_name=@0x6ec12001a740: {str = 0x6ec12001a6b0 "t1", length = 2}, path=@0x76c2580e96a8: {str = 0x76c2580e9730 "./test/t1", length = 9}, options={m_options = DDL_options_st::OPT_NONE}, create_info=0x76c2580e9ea8, alter_info=0x76c2580e9d30, create_table_mode=0, is_trans=0x76c2580e9a6f, key_info=0x76c2580e96f0, key_count=0x76c2580e96ec, frm=0x76c2580e96c0)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_table.cc:5439
      #15 0x00005e81261c5198 in mysql_create_table_no_lock (thd=0x6ec120000d60, ddl_log_state_create=0x76c2580e9a98, ddl_log_state_rm=0x76c2580e9a78, create_info=0x76c2580e9ea8, alter_info=0x76c2580e9d30, is_trans=0x76c2580e9a6f, create_table_mode=0, table_list=0x6ec12001a710)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_table.cc:5550
      #16 0x00005e81261e253e in mysql_create_table (thd=0x6ec120000d60, create_table=0x6ec12001a710, create_info=0x76c2580e9ea8, alter_info=0x76c2580e9d30)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_table.cc:5783
      #17 0x00005e81261e091f in Sql_cmd_create_table_like::execute (this=0x6ec12001a670, thd=0x6ec120000d60)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_table.cc:14325
      #18 0x00005e812609cb7f in mysql_execute_command (thd=0x6ec120000d60, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_parse.cc:5947
      #19 0x00005e812608bc24 in mysql_parse (thd=0x6ec120000d60, rawbuf=0x6ec12001a5a0 "CREATE TABLE t1 (j JSON, KEY (j(1))) CHARSET=latin1", length=51, parser_state=0x76c2580eba80)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_parse.cc:8005
      #20 0x00005e8126088fed in dispatch_command (command=COM_QUERY, thd=0x6ec120000d60, packet=0x6ec12000b7d1 "CREATE TABLE t1 (j JSON, KEY (j(1))) CHARSET=latin1", packet_length=51, blocking=true)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_parse.cc:1903
      #21 0x00005e812608c7d3 in do_command (thd=0x6ec120000d60, blocking=true)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_parse.cc:1437
      #22 0x00005e8126298099 in do_handle_one_connection (connect=0x5e814538d2d0, put_in_cache=true)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_connect.cc:1514
      #23 0x00005e8126297e3e in handle_one_connection (arg=0x5e81453157d0)at /test/mtest/MDEV-38740/pr5263_dbg/sql/sql_connect.cc:1426
      #24 0x000076c25989cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x000076c259929ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5h
                  0.5h

                  Git Integration

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