[MDEV-14396] Assertion `(ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) == Alter_inplace_info::CHANGE_CREATE_OPTION' failed in create_option_need_rebuild Created: 2017-11-14  Updated: 2017-11-15  Resolved: 2017-11-15

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Storage Engine - InnoDB
Affects Version/s: 10.3.3
Fix Version/s: 10.3.3

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-14016 Allow instant ADD COLUMN, ADD INDEX, ... Closed
Relates
relates to MDEV-13900 Testing for MDEV-11369 (instant ADD C... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MDEV-14397 Re-enable change_row_format in instan... Technical task Closed Elena Stepanova  

 Description   

--source include/have_innodb.inc
 
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN c INT, ROW_FORMAT=COMPACT;
 
# Cleanup
DROP TABLE t1;

10.3 c2a868b18cd

mysqld: /data/src/10.3/storage/innobase/handler/handler0alter.cc:457: bool create_option_need_rebuild(const Alter_inplace_info*, const TABLE*): Assertion `(ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) == Alter_inplace_info::CHANGE_CREATE_OPTION' failed.
171114 20:58:14 [ERROR] mysqld got signal 6 ;
 
#7  0x00007fbff15c8ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000555c33b2cca7 in create_option_need_rebuild (ha_alter_info=0x7fbfec05d520, table=0x7fbfa016e910) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:456
#9  0x0000555c33b2d0ca in instant_alter_column_possible (ha_alter_info=0x7fbfec05d520, table=0x7fbfa016e910) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:645
#10 0x0000555c33b2e3a6 in ha_innobase::check_if_supported_inplace_alter (this=0x7fbfa016f538, altered_table=0x7fbfa0172af0, ha_alter_info=0x7fbfec05d520) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:1119
#11 0x0000555c335e506c in mysql_alter_table (thd=0x7fbfa0000b00, new_db=0x7fbfa0015190 "test", new_name=0x0, create_info=0x7fbfec05ed60, table_list=0x7fbfa0014b80, alter_info=0x7fbfec05ecb0, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9155
#12 0x0000555c33664551 in Sql_cmd_alter_table::execute (this=0x7fbfa00152a0, thd=0x7fbfa0000b00) at /data/src/10.3/sql/sql_alter.cc:331
#13 0x0000555c33516e74 in mysql_execute_command (thd=0x7fbfa0000b00) at /data/src/10.3/sql/sql_parse.cc:6237
#14 0x0000555c3351b71e in mysql_parse (thd=0x7fbfa0000b00, rawbuf=0x7fbfa0014a68 "ALTER TABLE t1 ADD COLUMN c INT, ROW_FORMAT=COMPACT", length=51, parser_state=0x7fbfec060610, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7922
#15 0x0000555c335091f4 in dispatch_command (command=COM_QUERY, thd=0x7fbfa0000b00, packet=0x7fbfa008f8b1 "ALTER TABLE t1 ADD COLUMN c INT, ROW_FORMAT=COMPACT", packet_length=51, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1828
#16 0x0000555c33507c15 in do_command (thd=0x7fbfa0000b00) at /data/src/10.3/sql/sql_parse.cc:1370
#17 0x0000555c3365f0ca in do_handle_one_connection (connect=0x555c36120290) at /data/src/10.3/sql/sql_connect.cc:1418
#18 0x0000555c3365ee57 in handle_one_connection (arg=0x555c36120290) at /data/src/10.3/sql/sql_connect.cc:1324
#19 0x0000555c33adfbdc in pfs_spawn_thread (arg=0x555c36128950) at /data/src/10.3/storage/perfschema/pfs.cc:1863
#20 0x00007fbff329f494 in start_thread (arg=0x7fbfec061700) at pthread_create.c:333
#21 0x00007fbff168593f in clone () from /lib/x86_64-linux-gnu/libc.so.6



 Comments   
Comment by Marko Mäkelä [ 2017-11-15 ]

The assertion is too strict. We should only assert that the CHANGE_CREATE_OPTION flag is set, and not that some other flags are unset.

diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 5dff7e55c6c..517f2ee7631 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -473,8 +473,8 @@ static bool create_option_need_rebuild(
 	const Alter_inplace_info*	ha_alter_info,
 	const TABLE*			table)
 {
-	DBUG_ASSERT((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
-		    == Alter_inplace_info::CHANGE_CREATE_OPTION);
+	DBUG_ASSERT(ha_alter_info->handler_flags
+		    & Alter_inplace_info::CHANGE_CREATE_OPTION);
 
 	if (ha_alter_info->create_info->used_fields
 	    & (HA_CREATE_USED_ROW_FORMAT

Generated at Thu Feb 08 08:13:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.