Bug #96681 Setting Incorrect COMPRESSION value leads to a crash
Submitted: 28 Aug 2019 14:37 Modified: 29 Aug 2019 5:46
Reporter: Hrvoje Matijakovic Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S6 (Debug Builds)
Version:8.0.17 OS:Linux
Assigned to: CPU Architecture:x86

[28 Aug 2019 14:37] Hrvoje Matijakovic
Description:
Can't repeat on the release build, in that case ALTER results in an errror as well.

gdb:

Core was generated by `/sdc/MS230819-mysql-8.0.17-linux-x86_64-debug/bin/mysqld --no-defaults --basedi'.
Program terminated with signal 6, Aborted.
#0  0x00007f81b3d289d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
+bt
#0  0x00007f81b3d289d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
#1  0x0000000004580cc8 in my_write_core (sig=6) at /sdc/MS-8.0.17_dbg/mysys/stacktrace.cc:305
#2  0x00000000032f4d64 in handle_fatal_signal (sig=6) at /sdc/MS-8.0.17_dbg/sql/signal_handler.cc:168
#3  <signal handler called>
#4  0x00007f81b1e2b2c7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
#5  0x00007f81b1e2c9b8 in __GI_abort () at abort.c:90
#6  0x00007f81b1e240e6 in __assert_fail_base (fmt=0x7f81b1f7f020 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x57854e8 "!atomic || (error != 2 && error != 155)", file=file@entry=0x5784b50 "/sdc/MS-8.0.17_dbg/sql/sql_table.cc", line=line@entry=2783, function=function@entry=0x5788280 <drop_base_table(THD*, Drop_tables_ctx const&, TABLE_LIST*, bool, std::set<handlerton*, std::less<handlerton*>, std::allocator<handlerton*> >*, Foreign_key_parents_invalidator*, std::vector<MDL_ticket*, std::allocator<MDL_ticket*> >*)::__PRETTY_FUNCTION__> "bool drop_base_table(THD*, const Drop_tables_ctx&, TABLE_LIST*, bool, std::set<handlerton*>*, Foreign_key_parents_invalidator*, std::vector<MDL_ticket*>*)") at assert.c:92
#7  0x00007f81b1e24192 in __GI___assert_fail (assertion=0x57854e8 "!atomic || (error != 2 && error != 155)", file=0x5784b50 "/sdc/MS-8.0.17_dbg/sql/sql_table.cc", line=2783, function=0x5788280 <drop_base_table(THD*, Drop_tables_ctx const&, TABLE_LIST*, bool, std::set<handlerton*, std::less<handlerton*>, std::allocator<handlerton*> >*, Foreign_key_parents_invalidator*, std::vector<MDL_ticket*, std::allocator<MDL_ticket*> >*)::__PRETTY_FUNCTION__> "bool drop_base_table(THD*, const Drop_tables_ctx&, TABLE_LIST*, bool, std::set<handlerton*>*, Foreign_key_parents_invalidator*, std::vector<MDL_ticket*>*)") at assert.c:101
#8  0x00000000031c487b in drop_base_table (thd=0x7f8158021000, drop_ctx=..., table=0x7f81581f6ab0, atomic=true, post_ddl_htons=0x7f81b07cb410, fk_invalidator=0x7f81b07cb440, safe_to_release_mdl=0x7f81b07cb010) at /sdc/MS-8.0.17_dbg/sql/sql_table.cc:2783
#9  0x00000000031c594e in mysql_rm_table_no_locks (thd=0x7f8158021000, tables=0x7f81581f6ab0, if_exists=false, drop_temporary=false, drop_database=false, dropped_non_atomic_flag=0x7f81b07cb4ef, post_ddl_htons=0x7f81b07cb410, fk_invalidator=0x7f81b07cb440, safe_to_release_mdl=0x7f81b07cb4f0) at /sdc/MS-8.0.17_dbg/sql/sql_table.cc:3126
#10 0x00000000031c1a49 in mysql_rm_table (thd=0x7f8158021000, tables=0x7f81581f6ab0, if_exists=false, drop_temporary=false) at /sdc/MS-8.0.17_dbg/sql/sql_table.cc:1504
#11 0x000000000312a956 in mysql_execute_command (thd=0x7f8158021000, first_level=true) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:3444
#12 0x00000000031304fe in mysql_parse (thd=0x7f8158021000, parser_state=0x7f81b07ccaf0) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:5221
#13 0x0000000003125aa9 in dispatch_command (thd=0x7f8158021000, com_data=0x7f81b07cdb90, command=COM_QUERY) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:1755
#14 0x000000000312400c in do_command (thd=0x7f8158021000) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:1270
#15 0x00000000032dffcd in handle_connection (arg=0x7f8160c5c5c0) at /sdc/MS-8.0.17_dbg/sql/conn_handler/connection_handler_per_thread.cc:302
#16 0x0000000004d28926 in pfs_spawn_thread (arg=0x7f81afc69fe0) at /sdc/MS-8.0.17_dbg/storage/perfschema/pfs.cc:2854
#17 0x00007f81b3d23dd5 in start_thread (arg=0x7f81b07ce700) at pthread_create.c:307
#18 0x00007f81b1ef302d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) quit

How to repeat:
CREATE DATABASE test;
USE test;
set session innodb_strict_mode='OFF';
CREATE TABLE t0(c0 INT KEY)COMPRESSION="zlibX" ENGINE=InnoDB;
ALTER TABLE t0 ENGINE=InnoDB;
DROP TABLE t0;
[29 Aug 2019 5:46] Umesh Shastry
Hello Hrvoje Matijakovic,

Thank you for the report and test case.
Observed that 8.0.17 debug build is affected.

regards,
Umesh