|
Now 10.5 is affected too.
Also, the same test case, a different row format, different assertion, apparently the same problem:
--source include/have_innodb.inc
|
|
SET @row_format.save= @@innodb_default_row_format;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, KEY(a)) ENGINE=InnoDB;
|
SET GLOBAL innodb_default_row_format= COMPACT;
|
ALTER TABLE t1 DROP a;
|
|
# Cleanup
|
DROP TABLE t1;
|
SET GLOBAL innodb_default_row_format= @row_format.save;
|
|
10.4 00f964ab
|
mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:243: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `((flags & ((~(~0U << 1)) << ((0 + 1) + 4))) >> ((0 + 1) + 4)) == ((old.flags & ((~(~0U << 1)) << ((0 + 1) + 4))) >> ((0 + 1) + 4))' failed.
|
200803 17:56:28 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f33498f9f12 in __GI___assert_fail (assertion=0x560d82e63d28 "((flags & ((~(~0U << 1)) << ((0 + 1) + 4))) >> ((0 + 1) + 4)) == ((old.flags & ((~(~0U << 1)) << ((0 + 1) + 4))) >> ((0 + 1) + 4))", file=0x560d82e639b8 "/data/src/10.4/storage/innobase/handler/handler0alter.cc", line=243, function=0x560d82e6d5c0 <dict_table_t::prepare_instant(dict_table_t const&, unsigned long const*, unsigned int&)::__PRETTY_FUNCTION__> "void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&)") at assert.c:101
|
#8 0x0000560d8254608b in dict_table_t::prepare_instant (this=0x7f32f4057a80, old=..., col_map=0x7f32f4057538, first_alter_pos=@0x7f32f40148b0: 0) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:242
|
#9 0x0000560d8254d0fc in ha_innobase_inplace_ctx::prepare_instant (this=0x7f32f4014748) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:1079
|
#10 0x0000560d82530cb8 in prepare_inplace_alter_table_dict (ha_alter_info=0x7f33440a0d50, altered_table=0x7f33440a0df0, old_table=0x7f32f419ee80, table_name=0x7f32f41a17f5 "t1", flags=1, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:6779
|
#11 0x0000560d82537119 in ha_innobase::prepare_inplace_alter_table (this=0x7f32f419fce8, altered_table=0x7f33440a0df0, ha_alter_info=0x7f33440a0d50) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:8258
|
#12 0x0000560d822a8360 in handler::ha_prepare_inplace_alter_table (this=0x7f32f419fce8, altered_table=0x7f33440a0df0, ha_alter_info=0x7f33440a0d50) at /data/src/10.4/sql/handler.cc:4596
|
#13 0x0000560d8202eff6 in mysql_inplace_alter_table (thd=0x7f32f4000af0, table_list=0x7f32f4013270, table=0x7f32f419ee80, altered_table=0x7f33440a0df0, ha_alter_info=0x7f33440a0d50, target_mdl_request=0x7f33440a1bc0, alter_ctx=0x7f33440a2700) at /data/src/10.4/sql/sql_table.cc:7711
|
#14 0x0000560d82036122 in mysql_alter_table (thd=0x7f32f4000af0, new_db=0x7f32f40052b0, new_name=0x7f32f40056b8, create_info=0x7f33440a32f0, table_list=0x7f32f4013270, alter_info=0x7f33440a3230, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10156
|
#15 0x0000560d820ce58d in Sql_cmd_alter_table::execute (this=0x7f32f4013960, thd=0x7f32f4000af0) at /data/src/10.4/sql/sql_alter.cc:520
|
#16 0x0000560d81f4ba42 in mysql_execute_command (thd=0x7f32f4000af0) at /data/src/10.4/sql/sql_parse.cc:6098
|
#17 0x0000560d81f50f33 in mysql_parse (thd=0x7f32f4000af0, rawbuf=0x7f32f4013198 "ALTER TABLE t1 DROP a", length=21, parser_state=0x7f33440a4570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7896
|
#18 0x0000560d81f3d468 in dispatch_command (command=COM_QUERY, thd=0x7f32f4000af0, packet=0x7f32f40083a1 "ALTER TABLE t1 DROP a", packet_length=21, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1835
|
#19 0x0000560d81f3bc0a in do_command (thd=0x7f32f4000af0) at /data/src/10.4/sql/sql_parse.cc:1353
|
#20 0x0000560d820c4fa0 in do_handle_one_connection (connect=0x560d866c18e0) at /data/src/10.4/sql/sql_connect.cc:1412
|
#21 0x0000560d820c4cef in handle_one_connection (arg=0x560d866c18e0) at /data/src/10.4/sql/sql_connect.cc:1316
|
#22 0x0000560d82ac70d5 in pfs_spawn_thread (arg=0x560d865e42a0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
|
#23 0x00007f334b8824a4 in start_thread (arg=0x7f33440a5700) at pthread_create.c:456
|
#24 0x00007f33499b6d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Reproducible on 10.4-10.5
|
|
MDEV-23295 merely added the debug assertion, to be able to catch similar bugs.
This scenario differs from MDEV-23295 in the way that the problematic ALTER TABLE operation cannot be executed with ALGORITHM=INSTANT because it involves dropping a secondary index.
I am not sure if this qualifies as a true regression. But, clearly the following part of the fix of MDEV-23295 is insufficient:
prepare_inplace_alter_table_dict(): If we had promised that ALGORITHM=INPLACE is supported, we must preserve the ROW_FORMAT.
There is actually a typo in the commit message: it actually meant ALGORITHM=INSTANT. The special case that we missed is that also if ALGORITHM=NOCOPY was promised, we must preserve the ROW_FORMAT. For a table-rebuilding operation, it is desirable to use the specified ROW_FORMAT.
|