ALTERTABLE `p1b` COMMENT 'drop fk test', DROPFOREIGNKEY p1b_ibfk_1
it generates the following error:
(conn=41) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Note that this has worked without issue in all prior 10.1 and 10.2 versions we have used. Also, note that the following does NOT generate an error and does work correctly:
#7 0x00007f61b74bbee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000559121e92ceb in ha_innobase::inplace_alter_table (this=0x7f61680757a8, altered_table=0x7f6168172ce0, ha_alter_info=0x7f61b07fe420) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:7121
#9 0x000055912192527b in handler::ha_inplace_alter_table (this=0x7f61680757a8, altered_table=0x7f6168172ce0, ha_alter_info=0x7f61b07fe420) at /data/src/10.3/sql/handler.h:4155
#10 0x000055912191afe0 in mysql_inplace_alter_table (thd=0x7f6168000b00, table_list=0x7f6168014e38, table=0x7f6168074b60, altered_table=0x7f6168172ce0, ha_alter_info=0x7f61b07fe420, inplace_supported=HA_ALTER_INPLACE_NOCOPY_NO_LOCK, target_mdl_request=0x7f61b07fe490, alter_ctx=0x7f61b07ff090) at /data/src/10.3/sql/sql_table.cc:7570
#11 0x000055912192106c in mysql_alter_table (thd=0x7f6168000b00, new_db=0x7f61680051b0, new_name=0x7f6168005568, create_info=0x7f61b07ffc80, table_list=0x7f6168014e38, alter_info=0x7f61b07ffbc0, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9712
#12 0x00005591219a8011 in Sql_cmd_alter_table::execute (this=0x7f61680154f0, thd=0x7f6168000b00) at /data/src/10.3/sql/sql_alter.cc:495
#13 0x000055912184b377 in mysql_execute_command (thd=0x7f6168000b00) at /data/src/10.3/sql/sql_parse.cc:6281
#14 0x0000559121850371 in mysql_parse (thd=0x7f6168000b00, rawbuf=0x7f6168014d08 "alter table t2 COMMENT 'drop fk test', drop foreign key t2_ibfk_1", length=65, parser_state=0x7f61b08015f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8074
#15 0x000055912183d6d0 in dispatch_command (command=COM_QUERY, thd=0x7f6168000b00, packet=0x7f6168146841 "alter table t2 COMMENT 'drop fk test', drop foreign key t2_ibfk_1", packet_length=65, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1847
#16 0x000055912183c0f4 in do_command (thd=0x7f6168000b00) at /data/src/10.3/sql/sql_parse.cc:1392
#17 0x00005591219a25f1 in do_handle_one_connection (connect=0x5591249db9b0) at /data/src/10.3/sql/sql_connect.cc:1402
#18 0x00005591219a2375 in handle_one_connection (arg=0x5591249db9b0) at /data/src/10.3/sql/sql_connect.cc:1308
#19 0x0000559121e33c2d in pfs_spawn_thread (arg=0x559124a7cee0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
#20 0x00007f61b9192494 in start_thread (arg=0x7f61b0802700) at pthread_create.c:333
#21 0x00007f61b757893f in clone () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x000055cb2d2fec79 in ha_innobase::inplace_alter_table (this=0x7f59b0075580, altered_table=0x7f59b00681e8, ha_alter_info=0x7f5a0c0d9e80) at /data/src/10.3/storage/innobase/handler/handler0alter.cc:7206
#6 0x000055cb2ce36fa3 in ha_inplace_alter_table (ha_alter_info=0x7f5a0c0d9e80, altered_table=0x7f59b00681e8, this=<optimized out>) at /data/src/10.3/sql/handler.h:4155
After the refactoring of ALTER TABLE flags, setting a table comment will set the ALTER_OPTIONS flag, which is aliased by ALTER_CHANGE_CREATE_OPTION. I think that we should use the short flag name in InnoDB.
It looks like that this is a regression caused by MDEV-11369 or some follow-up work, such as MDEV-13134. The following should fix this test case:
Also, it looks like ADD COLUMN will unnecessarily require a table rebuild when combined with DROP FOREIGN KEY (or ADD FOREIGN KEY when foreign_key_cheks=0). I will add a test for that too.
Marko Mäkelä
added a comment - After the refactoring of ALTER TABLE flags , setting a table comment will set the ALTER_OPTIONS flag, which is aliased by ALTER_CHANGE_CREATE_OPTION . I think that we should use the short flag name in InnoDB.
It looks like that this is a regression caused by MDEV-11369 or some follow-up work, such as MDEV-13134 . The following should fix this test case:
@@ -7107,8 +7103,9 @@ ha_innobase::inplace_alter_table(
DBUG_RETURN(false);
}
- if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
- == ALTER_CHANGE_CREATE_OPTION
+ if ((ha_alter_info->handler_flags & ~(INNOBASE_INPLACE_IGNORE
+ | INNOBASE_ALTER_INSTANT))
+ == ALTER_OPTIONS
&& !create_option_need_rebuild(ha_alter_info, table)) {
goto ok_exit;
}
Also, it looks like ADD COLUMN will unnecessarily require a table rebuild when combined with DROP FOREIGN KEY (or ADD FOREIGN KEY when foreign_key_cheks=0 ). I will add a test for that too.
I was suspecting a similar problem in ADD COLUMN in combination with other instantaneous changes, such as DROP FOREIGN KEY, but that code was fine. I added a test case for it.
In MariaDB 10.3 before 10.3.9, this server crash can be worked around by changing the table comment in a separate ALTER TABLE statement.
Marko Mäkelä
added a comment - I was suspecting a similar problem in ADD COLUMN in combination with other instantaneous changes, such as DROP FOREIGN KEY , but that code was fine. I added a test case for it.
In MariaDB 10.3 before 10.3.9, this server crash can be worked around by changing the table comment in a separate ALTER TABLE statement.
(conn=1383) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Will the bug fix above also fix this problem or should it be submitted as a new bug?
Robert Dyas
added a comment - I just realized the same error is also caused by:
ALTER TABLE `Vendor` COMMENT 'tbl comment' , CHANGE COLUMN `Main_Fax` `Fax` varchar (30) COMMENT '' AFTER `Main_Phone`
which produces this error:
(conn=1383) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Will the bug fix above also fix this problem or should it be submitted as a new bug?
People
Marko Mäkelä
Robert Dyas
Votes:
0Vote for this issue
Watchers:
4Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
Would it be possible to get this assigned? This little bug is actually a blocking bug for use to use the 10.3 series.