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

Assertion `pos < table->n_v_def' failed

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q3/2026 Server Maintenance

    Description

      MTR compatible based testcase

      --source include/have_innodb.inc
      --source include/have_partition.inc
      SET sql_mode='';
      CREATE TABLE t5 (c1 INT,c3 INT AS(0) VIRTUAL) ENGINE=InnoDB PARTITION BY LIST(c1) (PARTITION p8 VALUES IN (8,9,10,11,12,13));
      CREATE TABLE t2 ENGINE=InnoDB AS SELECT * FROM t5;
      CREATE TABLE t3 LIKE t5;
      ALTER TABLE t3 CONVERT TABLE t2 TO PARTITION pn VALUES IN (1,2,3);
      INSERT INTO t3(c1) VALUES (1);
      

      Leads to:

      CS 12.3.2 66b3c6784689fbb65110a5b21efcb815a8bcde24 (Optimized, Clang 18.1.3-11) Build 24/05/2026

      Core was generated by `/test/MD240526-mariadb-12.3.2-linux-x86_64-opt/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  dfield_set_data (field=0x0, data=0x0, len=4294967295)at include/data0data.inl:93
      93		field->data = (void*) data;
      [Current thread is 1 (LWP 1431424)]
      (gdb) bt
      #0  dfield_set_data (field=0x0, data=0x0, len=4294967295)at include/data0data.inl:93
      #1  dfield_set_null (field=0x0) at include/data0data.inl:126
      #2  row_mysql_convert_row_to_innobase (row=0x730aac06a2b0, prebuilt=0x730aac069db8, mysql_rec=0x730aac05ae20 "\375\001", blob_heap=<optimized out>)at /test/12.3_opt/storage/innobase/row/row0mysql.cc:563
      #3  row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x730aac05ae20 "\375\001", prebuilt=0x730aac069db8, ins_mode=ROW_INS_NORMAL)at /test/12.3_opt/storage/innobase/row/row0mysql.cc:1272
      #4  0x0000575f3cd458d8 in ha_innobase::write_row (this=0x730aac05a5b0, record=0x730aac05ae20 "\375\001")at /test/12.3_opt/storage/innobase/handler/ha_innodb.cc:7765
      #5  0x0000575f3ca59281 in handler::ha_write_row (this=0x730aac05a5b0, buf=0x730aac05ae20 "\375\001") at /test/12.3_opt/sql/handler.cc:8521
      #6  0x0000575f3cca603b in ha_partition::write_row (this=0x730aac059420, buf=0x730aac05ae20 "\375\001") at /test/12.3_opt/sql/ha_partition.cc:4631
      #7  0x0000575f3ca59281 in handler::ha_write_row (this=0x730aac059420, buf=0x730aac05ae20 "\375\001") at /test/12.3_opt/sql/handler.cc:8521
      #8  0x0000575f3c78ae62 in Write_record::single_insert (this=this@entry=0x7b0be1477a00, inserted=inserted@entry=0x7b0be14779a8)at /test/12.3_opt/sql/sql_insert.cc:2390
      #9  0x0000575f3c7899eb in Write_record::write_record (this=this@entry=0x7b0be1477a00) at /test/12.3_opt/sql/sql_insert.cc:2432
      #10 0x0000575f3c787d9b in mysql_insert (thd=thd@entry=0x730aac000c70, table_list=0x730aac017b00, fields=@0x730aac006168: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x730aac018390, last = 0x730aac018390, elements = 1}, <No data fields>}, values_list=@0x730aac0061b0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x730aac018950, last = 0x730aac018950, elements = 1}, <No data fields>}, update_fields=@0x730aac006198: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x575f3dacd3d8 <end_of_list>, last = 0x730aac006198, elements = 0}, <No data fields>}, update_values=@0x730aac006180: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x575f3dacd3d8 <end_of_list>, last = 0x730aac006180, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=<optimized out>, result=0x0)at /test/12.3_opt/sql/sql_insert.cc:1233
      #11 0x0000575f3c7c72ba in mysql_execute_command (thd=thd@entry=0x730aac000c70, is_called_from_prepared_stmt=false) at /test/12.3_opt/sql/sql_parse.cc:4505
      #12 0x0000575f3c7bfd11 in mysql_parse (thd=thd@entry=0x730aac000c70, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7b0be1478410)at /test/12.3_opt/sql/sql_parse.cc:7949
      #13 0x0000575f3c7be12d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x730aac000c70, packet=packet@entry=0x730aac008d81 "INSERT INTO t3(c1) VALUES (1)", packet_length=packet_length@entry=29, blocking=true)at /test/12.3_opt/sql/sql_parse.cc:1903
      #14 0x0000575f3c7c0121 in do_command (thd=thd@entry=0x730aac000c70, blocking=true) at /test/12.3_opt/sql/sql_parse.cc:1437
      #15 0x0000575f3c8f162d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x575f70545550, put_in_cache=true)at /test/12.3_opt/sql/sql_connect.cc:1503
      #16 0x0000575f3c8f13ef in handle_one_connection (arg=arg@entry=0x575f70545550)at /test/12.3_opt/sql/sql_connect.cc:1415
      #17 0x0000575f3ccb37f3 in pfs_spawn_thread (arg=0x575f70564ab0)at /test/12.3_opt/storage/perfschema/pfs.cc:2198
      #18 0x00007b0be469caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #19 0x00007b0be4729c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      CS 12.3.2 66b3c6784689fbb65110a5b21efcb815a8bcde24 (Debug, Clang 18.1.3-11) Build 24/05/2026

      mariadbd: /test/12.3_dbg/storage/innobase/include/dict0dict.inl:337: dict_v_col_t *dict_table_get_nth_v_col(const dict_table_t *, ulint): Assertion `pos < table->n_v_def' failed.
      

      CS 12.3.2 66b3c6784689fbb65110a5b21efcb815a8bcde24 (Debug, Clang 18.1.3-11) Build 24/05/2026

      Core was generated by `/test/MD240526-mariadb-12.3.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      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 1431068)]
      (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  0x00007c3b32a4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007c3b32a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007c3b32a2881b in __assert_fail_base (fmt=0x7c3b32bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5d1e7fc2787c "pos < table->n_v_def", file=file@entry=0x5d1e7fc27748 "/test/12.3_dbg/storage/innobase/include/dict0dict.inl", line=line@entry=337, function=function@entry=0x5d1e7fc27838 "dict_v_col_t *dict_table_get_nth_v_col(const dict_table_t *, ulint)") at ./assert/assert.c:96
      #6  0x00007c3b32a3b517 in __assert_fail (assertion=0x5d1e7fc2787c "pos < table->n_v_def", file=0x5d1e7fc27748 "/test/12.3_dbg/storage/innobase/include/dict0dict.inl", line=337, function=0x5d1e7fc27838 "dict_v_col_t *dict_table_get_nth_v_col(const dict_table_t *, ulint)") at ./assert/assert.c:105
      #7  0x00005d1e7f2256b5 in dict_table_get_nth_v_col (table=0x7439fc082368, pos=0) at include/dict0dict.inl:337
      #8  0x00005d1e7f22badd in build_template_field (prebuilt=0x7439fc091d08, clust_index=0x7439fc082d28, index=0x7439fc082d28, table=0x7439fc0952a0, field=0x7439fc086260, i=1, v_no=0)at /test/12.3_dbg/storage/innobase/handler/ha_innodb.cc:7102
      #9  0x00005d1e7f22ab09 in ha_innobase::build_template (this=0x7439fc0858b0, whole_row=true)at /test/12.3_dbg/storage/innobase/handler/ha_innodb.cc:7547
      #10 0x00005d1e7f22c723 in ha_innobase::write_row (this=0x7439fc0858b0, record=0x7439fc086120 "\375\001")at /test/12.3_dbg/storage/innobase/handler/ha_innodb.cc:7758
      #11 0x00005d1e7ee1304f in handler::ha_write_row (this=0x7439fc0858b0, buf=0x7439fc086120 "\375\001") at /test/12.3_dbg/sql/handler.cc:8521
      #12 0x00005d1e7f1b1053 in ha_partition::write_row (this=0x7439fc084720, buf=0x7439fc086120 "\375\001") at /test/12.3_dbg/sql/ha_partition.cc:4631
      #13 0x00005d1e7ee1304f in handler::ha_write_row (this=0x7439fc084720, buf=0x7439fc086120 "\375\001") at /test/12.3_dbg/sql/handler.cc:8521
      #14 0x00005d1e7e93f7ae in Write_record::single_insert (this=0x7c3b0c174f10, inserted=0x7c3b0c174a40) at /test/12.3_dbg/sql/sql_insert.cc:2390
      #15 0x00005d1e7e93d4b5 in Write_record::write_record (this=0x7c3b0c174f10)at /test/12.3_dbg/sql/sql_insert.cc:2432
      #16 0x00005d1e7e93a7bf in mysql_insert (thd=0x7439fc000d60, table_list=0x7439fc01a360, fields=@0x7439fc006230: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7439fc01abf0, last = 0x7439fc01abf0, elements = 1}, <No data fields>}, values_list=@0x7439fc006278: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7439fc01b1b0, last = 0x7439fc01b1b0, elements = 1}, <No data fields>}, update_fields=@0x7439fc006260: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5d1e80789440 <end_of_list>, last = 0x7439fc006260, elements = 0}, <No data fields>}, update_values=@0x7439fc006248: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5d1e80789440 <end_of_list>, last = 0x7439fc006248, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/12.3_dbg/sql/sql_insert.cc:1233
      #17 0x00005d1e7e9a667e in mysql_execute_command (thd=0x7439fc000d60, is_called_from_prepared_stmt=false) at /test/12.3_dbg/sql/sql_parse.cc:4505
      #18 0x00005d1e7e99c284 in mysql_parse (thd=0x7439fc000d60, rawbuf=0x7439fc01a250 "INSERT INTO t3(c1) VALUES (1)", length=29, parser_state=0x7c3b0c1769f0) at /test/12.3_dbg/sql/sql_parse.cc:7949
      #19 0x00005d1e7e9995cd in dispatch_command (command=COM_QUERY, thd=0x7439fc000d60, packet=0x7439fc00b5e1 "INSERT INTO t3(c1) VALUES (1)", packet_length=29, blocking=true) at /test/12.3_dbg/sql/sql_parse.cc:1903
      #20 0x00005d1e7e99ce33 in do_command (thd=0x7439fc000d60, blocking=true)at /test/12.3_dbg/sql/sql_parse.cc:1437
      #21 0x00005d1e7eb99409 in do_handle_one_connection (connect=0x5d1e8571e790, put_in_cache=true) at /test/12.3_dbg/sql/sql_connect.cc:1503
      #22 0x00005d1e7eb991ae in handle_one_connection (arg=0x5d1e8568ea70)at /test/12.3_dbg/sql/sql_connect.cc:1415
      #23 0x00007c3b32a9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #24 0x00007c3b32b29c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  240526  b2050fdb4a8776422baf01a41bf86845994edb97  No bug found                  
      CS  10.6   opt  240526  b2050fdb4a8776422baf01a41bf86845994edb97  No bug found                  
      CS  10.11  dbg  240526  9ed3a7f9f6929aa34420a8616930844d3a35bb91  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      CS  10.11  opt  240526  9ed3a7f9f6929aa34420a8616930844d3a35bb91  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      CS  11.4   dbg  240526  19c59f2c79637cc360cc6d6b219ed9131124500d  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      CS  11.4   opt  240526  19c59f2c79637cc360cc6d6b219ed9131124500d  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      CS  11.8   dbg  240526  b494164767979072713fdeccc175ce3b3f5b1983  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      CS  11.8   opt  240526  b494164767979072713fdeccc175ce3b3f5b1983  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      CS  12.3   dbg  240526  66b3c6784689fbb65110a5b21efcb815a8bcde24  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      CS  12.3   opt  240526  66b3c6784689fbb65110a5b21efcb815a8bcde24  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      CS  13.0   dbg  240526  c8e8d33309606e682c98675d594dbd23ebc2ddf6  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      CS  13.0   opt  240526  c8e8d33309606e682c98675d594dbd23ebc2ddf6  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      ES  10.6   dbg  240526  55cfada6c54d1b08f2372adc1369a5e5e76f472d  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      ES  10.6   opt  240526  55cfada6c54d1b08f2372adc1369a5e5e76f472d  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      ES  11.4   dbg  240526  90f707057d44f1b5c013a0c3672fd12f32ea7085  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      ES  11.4   opt  240526  90f707057d44f1b5c013a0c3672fd12f32ea7085  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      ES  11.8   dbg  240526  d4fbd664a4514441bb3d9042c0089842ee6fc3c8  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      ES  11.8   opt  240526  d4fbd664a4514441bb3d9042c0089842ee6fc3c8  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      ES  12.3   dbg  240526  4063148254974421994024b7cc94f6f2a850177d  pos < table->n_v_def|SIGABRT|dict_table_get_nth_v_col|build_template_field|ha_innobase::build_template|ha_innobase::write_row
      ES  12.3   opt  240526  4063148254974421994024b7cc94f6f2a850177d  SIGSEGV|dfield_set_data|dfield_set_null|row_mysql_convert_row_to_innobase|row_insert_for_mysql
      

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.