MDEV-24802InnoDB: Assertion failure in file /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.5.8/storage/innobase/data/data0type.cc line 67
Closed
MDEV-25951MariaDB crash after ALTER TABLE convert to utf8mb4
#12 0x0000556b437021ee in ha_innobase::inplace_alter_table (this=0x7f75081a09d8, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:8383
#13 0x0000556b432070f5 in handler::ha_inplace_alter_table (this=0x7f75081a09d8, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790) at /data/src/10.4/sql/handler.h:4328
#14 0x0000556b431fb35a in mysql_inplace_alter_table (thd=0x7f7508000b00, table_list=0x7f75080132e8, table=0x7f750819fb70, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790, inplace_supported=HA_ALTER_INPLACE_NOCOPY_NO_LOCK, target_mdl_request=0x7f75540e15f0, alter_ctx=0x7f75540e2120) at /data/src/10.4/sql/sql_table.cc:7715
#15 0x0000556b432020b4 in mysql_alter_table (thd=0x7f7508000b00, new_db=0x7f75080052b8, new_name=0x7f75080056c0, create_info=0x7f75540e2d10, table_list=0x7f75080132e8, alter_info=0x7f75540e2c50, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10086
#16 0x0000556b432994f3 in Sql_cmd_alter_table::execute (this=0x7f7508013bf8, thd=0x7f7508000b00) at /data/src/10.4/sql/sql_alter.cc:508
#17 0x0000556b43119983 in mysql_execute_command (thd=0x7f7508000b00) at /data/src/10.4/sql/sql_parse.cc:6094
#18 0x0000556b4311f057 in mysql_parse (thd=0x7f7508000b00, rawbuf=0x7f7508013128 "ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT '\320\236\321\202\320\267\321\213\320\262 \320\272\320\273\320\270\320\265\320\275\321\202\320\260'", length=110, parser_state=0x7f75540e4170, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7912
#19 0x0000556b4310a2ea in dispatch_command (command=COM_QUERY, thd=0x7f7508000b00, packet=0x7f7508137a81 "ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT '\320\236\321\202\320\267\321\213\320\262 \320\272\320\273\320\270\320\265\320\275\321\202\320\260'", packet_length=110, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1841
#20 0x0000556b43108977 in do_command (thd=0x7f7508000b00) at /data/src/10.4/sql/sql_parse.cc:1359
#21 0x0000556b4328fe03 in do_handle_one_connection (connect=0x556b46707fd0) at /data/src/10.4/sql/sql_connect.cc:1412
#22 0x0000556b4328fb52 in handle_one_connection (arg=0x556b46707fd0) at /data/src/10.4/sql/sql_connect.cc:1316
#23 0x0000556b43c8ecab in pfs_spawn_thread (arg=0x556b466862b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
#24 0x00007f755c8884a4 in start_thread (arg=0x7f75540e5700) at pthread_create.c:456
#25 0x00007f755add0d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
Also fails on 10.4.7. Didn't check earlier 10.4.
Not reproducible on 10.3.
Elena Stepanova
added a comment - Thanks for the report and test case.
Same test case, just put together for MTR:
--source include/have_innodb.inc
CREATE TABLE `ratings_copy` (
`id` int (10) unsigned NOT NULL AUTO_INCREMENT,
`ctime` timestamp NOT NULL DEFAULT current_timestamp (),
`order_id` int (10) unsigned NOT NULL ,
`client_id` int (10) unsigned DEFAULT NULL ,
`courier_id` int (10) unsigned DEFAULT NULL ,
`dispatcher_id` int (10) unsigned DEFAULT NULL ,
`point_id` int (10) unsigned DEFAULT NULL ,
`problem_id` int (10) unsigned DEFAULT NULL ,
`courier_rating` int (11) DEFAULT NULL COMMENT 'Оценка курьера клиентом' ,
`courier_rating_comment` text CHARACTER SET utf8 DEFAULT NULL COMMENT 'Отзыв клиента' ,
`actual_rating` int (11) DEFAULT NULL ,
`dispatcher_comment` text CHARACTER SET utf8 DEFAULT NULL COMMENT 'Комментарий диспетчера' ,
PRIMARY KEY (`id`),
UNIQUE KEY `problem_id` (`problem_id`),
KEY `courier_id` (`courier_id`),
KEY `order_id` (`order_id`),
KEY `client_id` (`client_id`),
KEY `idx_dispatcher_comment_courier_rating` (`dispatcher_comment`(1),`courier_rating`),
KEY `idx_courier_rating_comment_courier_rating` (`courier_rating_comment`(1),`courier_rating`),
KEY `idx_courier_rating` (`courier_rating`),
KEY `courier_client` (`courier_id`,`client_id`),
KEY `client_id_rating_ctime` (`client_id`,`courier_rating`,`ctime`)
) ENGINE=InnoDB AUTO_INCREMENT=14807 DEFAULT CHARSET=utf8mb4 COLLATE =utf8mb4_unicode_ci COMMENT= 'Оценка качества услуг клиентом' ;
INSERT INTO `ratings_copy` VALUES (14807, '0000-00-00 00:00:00' ,0,0,0,0,0,0,0, '\"courier_rating_comment\"' ,0, '\"dispatcher_comment\"' ),(14808, '0000-00-00 00:00:00' ,0, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ),(14809, '0000-00-00 00:00:00' ,0, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ),(14810, '0000-00-00 00:00:00' ,0, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ),(14811, '0000-00-00 00:00:00' ,0, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ),(14812, '0000-00-00 00:00:00' ,0, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL );
ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT 'Отзыв клиента' ;
10.4 9b5cdeeb
mysqld: /data/src/10.4/storage/innobase/data/data0type.cc:64: ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*): Assertion `!mbmaxlen || !(prefix_len % mbmaxlen)' failed.
191002 20:23:03 [ERROR] mysqld got signal 6 ;
#7 0x00007f755ad13f12 in __GI___assert_fail (assertion=0x556b440f8d30 "!mbmaxlen || !(prefix_len % mbmaxlen)", file=0x556b440f8ce0 "/data/src/10.4/storage/innobase/data/data0type.cc", line=64, function=0x556b440f8f80 <dtype_get_at_most_n_mbchars(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, char const*)::__PRETTY_FUNCTION__> "ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*)") at assert.c:101
#8 0x0000556b439fae98 in dtype_get_at_most_n_mbchars (prtype=2162940, mbminlen=1, mbmaxlen=3, prefix_len=4, data_len=24, str=0x7f75548ac0b2 "\"courier_rating_comment\"\200") at /data/src/10.4/storage/innobase/data/data0type.cc:64
#9 0x0000556b4383e638 in row_merge_buf_add (buf=0x7f75081a7a78, fts_index=0x0, old_table=0x7f750818d4e8, new_table=0x7f750818d4e8, psort_info=0x0, row=0x7f75083cb130, ext=0x0, doc_id=0x7f75540deca8, conv_heap=0x0, err=0x7f75540dec8c, v_heap=0x7f75540deca0, my_table=0x7f75540e0820, trx=0x7f7554b7d140) at /data/src/10.4/storage/innobase/row/row0merge.cc:743
#10 0x0000556b4384552d in row_merge_read_clustered_index (trx=0x7f7554b7d140, table=0x7f75540e0820, old_table=0x7f750818d4e8, new_table=0x7f750818d4e8, online=true, index=0x7f75081a6d38, fts_sort_idx=0x0, psort_info=0x0, files=0x7f75080be970, key_numbers=0x7f75081a6d40, n_index=1, defaults=0x0, add_v=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., block=0x7f754c0f4000 "", skip_pk_sort=false, tmpfd=0x7f75540df940, stage=0x7f75081a7990, pct_cost=50, crypt_block=0x0, eval_table=0x7f75540e0820, allow_not_null=false) at /data/src/10.4/storage/innobase/row/row0merge.cc:2362
#11 0x0000556b4384cd77 in row_merge_build_indexes (trx=0x7f7554b7d140, old_table=0x7f750818d4e8, new_table=0x7f750818d4e8, online=true, indexes=0x7f75081a6d38, key_numbers=0x7f75081a6d40, n_indexes=1, table=0x7f75540e0820, defaults=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=false, stage=0x7f75081a7990, add_v=0x0, eval_table=0x7f75540e0820, allow_not_null=false) at /data/src/10.4/storage/innobase/row/row0merge.cc:4718
#12 0x0000556b437021ee in ha_innobase::inplace_alter_table (this=0x7f75081a09d8, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:8383
#13 0x0000556b432070f5 in handler::ha_inplace_alter_table (this=0x7f75081a09d8, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790) at /data/src/10.4/sql/handler.h:4328
#14 0x0000556b431fb35a in mysql_inplace_alter_table (thd=0x7f7508000b00, table_list=0x7f75080132e8, table=0x7f750819fb70, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790, inplace_supported=HA_ALTER_INPLACE_NOCOPY_NO_LOCK, target_mdl_request=0x7f75540e15f0, alter_ctx=0x7f75540e2120) at /data/src/10.4/sql/sql_table.cc:7715
#15 0x0000556b432020b4 in mysql_alter_table (thd=0x7f7508000b00, new_db=0x7f75080052b8, new_name=0x7f75080056c0, create_info=0x7f75540e2d10, table_list=0x7f75080132e8, alter_info=0x7f75540e2c50, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10086
#16 0x0000556b432994f3 in Sql_cmd_alter_table::execute (this=0x7f7508013bf8, thd=0x7f7508000b00) at /data/src/10.4/sql/sql_alter.cc:508
#17 0x0000556b43119983 in mysql_execute_command (thd=0x7f7508000b00) at /data/src/10.4/sql/sql_parse.cc:6094
#18 0x0000556b4311f057 in mysql_parse (thd=0x7f7508000b00, rawbuf=0x7f7508013128 "ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT '\320\236\321\202\320\267\321\213\320\262 \320\272\320\273\320\270\320\265\320\275\321\202\320\260'", length=110, parser_state=0x7f75540e4170, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7912
#19 0x0000556b4310a2ea in dispatch_command (command=COM_QUERY, thd=0x7f7508000b00, packet=0x7f7508137a81 "ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT '\320\236\321\202\320\267\321\213\320\262 \320\272\320\273\320\270\320\265\320\275\321\202\320\260'", packet_length=110, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1841
#20 0x0000556b43108977 in do_command (thd=0x7f7508000b00) at /data/src/10.4/sql/sql_parse.cc:1359
#21 0x0000556b4328fe03 in do_handle_one_connection (connect=0x556b46707fd0) at /data/src/10.4/sql/sql_connect.cc:1412
#22 0x0000556b4328fb52 in handle_one_connection (arg=0x556b46707fd0) at /data/src/10.4/sql/sql_connect.cc:1316
#23 0x0000556b43c8ecab in pfs_spawn_thread (arg=0x556b466862b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
#24 0x00007f755c8884a4 in start_thread (arg=0x7f75540e5700) at pthread_create.c:456
#25 0x00007f755add0d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
Also fails on 10.4.7. Didn't check earlier 10.4.
Not reproducible on 10.3.
Alice Sherepa
added a comment - please check also the test case from MDEV-21214 :
CREATE TABLE t1 ( id varchar (25), KEY id (id(19))) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ( 'Zone' ), ( 'Zone' ), ( 'Zone' );
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4;
This is still broken in 10.4.12, and renders me unable to upgrade a Wordpress installation. Being that's its a showstopper, with a patch available, why has there been no action for months?
Roger
added a comment - This is still broken in 10.4.12, and renders me unable to upgrade a Wordpress installation. Being that's its a showstopper, with a patch available, why has there been no action for months?
Thanks for the report and test case.
Same test case, just put together for MTR:
--source include/have_innodb.inc
10.4 9b5cdeeb
mysqld: /data/src/10.4/storage/innobase/data/data0type.cc:64: ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*): Assertion `!mbmaxlen || !(prefix_len % mbmaxlen)' failed.
191002 20:23:03 [ERROR] mysqld got signal 6 ;
#7 0x00007f755ad13f12 in __GI___assert_fail (assertion=0x556b440f8d30 "!mbmaxlen || !(prefix_len % mbmaxlen)", file=0x556b440f8ce0 "/data/src/10.4/storage/innobase/data/data0type.cc", line=64, function=0x556b440f8f80 <dtype_get_at_most_n_mbchars(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, char const*)::__PRETTY_FUNCTION__> "ulint dtype_get_at_most_n_mbchars(ulint, ulint, ulint, ulint, ulint, const char*)") at assert.c:101
#8 0x0000556b439fae98 in dtype_get_at_most_n_mbchars (prtype=2162940, mbminlen=1, mbmaxlen=3, prefix_len=4, data_len=24, str=0x7f75548ac0b2 "\"courier_rating_comment\"\200") at /data/src/10.4/storage/innobase/data/data0type.cc:64
#9 0x0000556b4383e638 in row_merge_buf_add (buf=0x7f75081a7a78, fts_index=0x0, old_table=0x7f750818d4e8, new_table=0x7f750818d4e8, psort_info=0x0, row=0x7f75083cb130, ext=0x0, doc_id=0x7f75540deca8, conv_heap=0x0, err=0x7f75540dec8c, v_heap=0x7f75540deca0, my_table=0x7f75540e0820, trx=0x7f7554b7d140) at /data/src/10.4/storage/innobase/row/row0merge.cc:743
#10 0x0000556b4384552d in row_merge_read_clustered_index (trx=0x7f7554b7d140, table=0x7f75540e0820, old_table=0x7f750818d4e8, new_table=0x7f750818d4e8, online=true, index=0x7f75081a6d38, fts_sort_idx=0x0, psort_info=0x0, files=0x7f75080be970, key_numbers=0x7f75081a6d40, n_index=1, defaults=0x0, add_v=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., block=0x7f754c0f4000 "", skip_pk_sort=false, tmpfd=0x7f75540df940, stage=0x7f75081a7990, pct_cost=50, crypt_block=0x0, eval_table=0x7f75540e0820, allow_not_null=false) at /data/src/10.4/storage/innobase/row/row0merge.cc:2362
#11 0x0000556b4384cd77 in row_merge_build_indexes (trx=0x7f7554b7d140, old_table=0x7f750818d4e8, new_table=0x7f750818d4e8, online=true, indexes=0x7f75081a6d38, key_numbers=0x7f75081a6d40, n_indexes=1, table=0x7f75540e0820, defaults=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=false, stage=0x7f75081a7990, add_v=0x0, eval_table=0x7f75540e0820, allow_not_null=false) at /data/src/10.4/storage/innobase/row/row0merge.cc:4718
#12 0x0000556b437021ee in ha_innobase::inplace_alter_table (this=0x7f75081a09d8, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:8383
#13 0x0000556b432070f5 in handler::ha_inplace_alter_table (this=0x7f75081a09d8, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790) at /data/src/10.4/sql/handler.h:4328
#14 0x0000556b431fb35a in mysql_inplace_alter_table (thd=0x7f7508000b00, table_list=0x7f75080132e8, table=0x7f750819fb70, altered_table=0x7f75540e0820, ha_alter_info=0x7f75540e0790, inplace_supported=HA_ALTER_INPLACE_NOCOPY_NO_LOCK, target_mdl_request=0x7f75540e15f0, alter_ctx=0x7f75540e2120) at /data/src/10.4/sql/sql_table.cc:7715
#15 0x0000556b432020b4 in mysql_alter_table (thd=0x7f7508000b00, new_db=0x7f75080052b8, new_name=0x7f75080056c0, create_info=0x7f75540e2d10, table_list=0x7f75080132e8, alter_info=0x7f75540e2c50, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10086
#16 0x0000556b432994f3 in Sql_cmd_alter_table::execute (this=0x7f7508013bf8, thd=0x7f7508000b00) at /data/src/10.4/sql/sql_alter.cc:508
#17 0x0000556b43119983 in mysql_execute_command (thd=0x7f7508000b00) at /data/src/10.4/sql/sql_parse.cc:6094
#18 0x0000556b4311f057 in mysql_parse (thd=0x7f7508000b00, rawbuf=0x7f7508013128 "ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT '\320\236\321\202\320\267\321\213\320\262 \320\272\320\273\320\270\320\265\320\275\321\202\320\260'", length=110, parser_state=0x7f75540e4170, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7912
#19 0x0000556b4310a2ea in dispatch_command (command=COM_QUERY, thd=0x7f7508000b00, packet=0x7f7508137a81 "ALTER TABLE `ratings_copy` MODIFY courier_rating_comment text DEFAULT NULL COMMENT '\320\236\321\202\320\267\321\213\320\262 \320\272\320\273\320\270\320\265\320\275\321\202\320\260'", packet_length=110, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1841
#20 0x0000556b43108977 in do_command (thd=0x7f7508000b00) at /data/src/10.4/sql/sql_parse.cc:1359
#21 0x0000556b4328fe03 in do_handle_one_connection (connect=0x556b46707fd0) at /data/src/10.4/sql/sql_connect.cc:1412
#22 0x0000556b4328fb52 in handle_one_connection (arg=0x556b46707fd0) at /data/src/10.4/sql/sql_connect.cc:1316
#23 0x0000556b43c8ecab in pfs_spawn_thread (arg=0x556b466862b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
#24 0x00007f755c8884a4 in start_thread (arg=0x7f75540e5700) at pthread_create.c:456
#25 0x00007f755add0d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
Also fails on 10.4.7. Didn't check earlier 10.4.
Not reproducible on 10.3.