Bug #98593 InnoDB crash when drop table in debug mode
Submitted: 14 Feb 2020 7:13 Modified: 15 May 2020 17:59
Reporter: Zhao Jianwei Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S6 (Debug Builds)
Version:8.0.19 OS:Any
Assigned to: CPU Architecture:Any

[14 Feb 2020 7:13] Zhao Jianwei

Up to MySQL 8.0.19 version, MySQL server crashed when I DROP TABLE which has invalid COMPRESSION clause such as "COMPRESSION='zlibX' ",  the table was created within INNODB_STRICT_MODE = OFF;

The backtrace as below:

mysqld: sql/sql_table.cc:2771: bool drop_base_table(THD*, const Drop_tables_ctx&, TABLE_LIST*, bool, std::set<handlerton*>*, Foreign_key_parents_invalidator*, std::vector<MDL_ticket*>*): Assertion `!atomic || (error != 2 && error != 155)' failed.
07:01:26 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x62700032f900
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f2c77c629d0 thread_stack 0x46000
/usr/lib64/libasan.so.4(+0x55610) [0x7f2ca1b63610]
runtime_output_directory/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0xbb) [0x665e7b9]
runtime_output_directory/mysqld(handle_fatal_signal+0x561) [0x3a7764f]
/usr/lib64/libpthread.so.0(+0xf620) [0x7f2ca1901620]
/usr/lib64/libc.so.6(gsignal+0x37) [0x7f2ca04f5277]
/usr/lib64/libc.so.6(abort+0x148) [0x7f2ca04f6968]
/usr/lib64/libc.so.6(+0x2f096) [0x7f2ca04ee096]
/usr/lib64/libc.so.6(+0x2f142) [0x7f2ca04ee142]
runtime_output_directory/mysqld() [0x36dc4c3]
runtime_output_directory/mysqld(mysql_rm_table_no_locks(THD*, TABLE_LIST*, ...) [0x36dec30]
runtime_output_directory/mysqld(mysql_rm_table(THD*, TABLE_LIST*, bool, bool)+0x935) [0x36d4d5b]
runtime_output_directory/mysqld(mysql_execute_command(THD*, bool)+0x531c) [0x3559e8c]
runtime_output_directory/mysqld(mysql_parse(THD*, Parser_state*)+0xddd) [0x356817a]
runtime_output_directory/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x2918) [0x354f509]

Through the codes, maybe, function format_validate() in dict/dict0dd.cc  should judge the variable INNODB_STRICT_MODE if err == DB_UNSUPPORTED as below:

1282   if (const char *algorithm =
1283           form->s->compress.length > 0 ? form->s->compress.str : nullptr) {
1284     Compression compression;
1285     dberr_t err = Compression::check(algorithm, &compression);
1287     if (err == DB_UNSUPPORTED) {
1288       my_error(ER_WRONG_VALUE, MYF(0), "COMPRESSION", algorithm);
1289       invalid = true;
1290     } else if (compression.m_type != Compression::NONE) {
1291       if (*zip_ssize != 0) {

How to repeat:
see the test case file.  require debug mode.
[14 Feb 2020 7:19] Zhao Jianwei
test case

Attachment: t.test (application/octet-stream, text), 1.19 KiB.

[14 Feb 2020 7:27] MySQL Verification Team
Hello Zhao Jianwei,

Thank you for the report and test case.

[15 May 2020 17:59] Daniel Price
Posted by developer:
Fixed as of the upcoming 8.0.21 release, and here's the proposed changelog entry from the documentation team:

In debug mode, a DROP TABLE operation on a table with an incorrectly
defined COMPRESSION clause caused a failure. InnoDB did not return an
error to the caller for proper handling.
[28 Aug 2020 5:31] MySQL Verification Team
Bug #100667 marked as duplicate of this one