Bug #78728 InnoDB: Failing assertion: 0 in file ha_innopart.cc line 3526
Submitted: 7 Oct 2015 1:10 Modified: 29 Oct 2015 21:30
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S6 (Debug Builds)
Version:5.7.8 (RC2), 5.7.10, 8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[7 Oct 2015 1:10] Roel Van de Paar
Description:
On Debug:

Version: '5.7.8-rc-debug'  socket: '/sda/mysql-5.7.8-rc-linux-x86_64-debug/socket.sock'  port: 16775  MySQL Community Server (GPL)
2015-10-07T01:00:29.041754Z 2 [ERROR] InnoDB: Cannot delete tablespace 23 because it is not found in the tablespace memory cache.
2015-10-07T01:00:29.042452Z 2 [ERROR] InnoDB: Cannot delete tablespace 24 because it is not found in the tablespace memory cache.
2015-10-07T01:00:29.043148Z 2 [ERROR] InnoDB: Cannot delete tablespace 25 because it is not found in the tablespace memory cache.
2015-10-07T01:00:29.043821Z 2 [ERROR] InnoDB: Cannot delete tablespace 26 because it is not found in the tablespace memory cache.
2015-10-07T01:00:29.746231Z 2 [Warning] InnoDB: Cannot calculate statistics for table `test`.`t3_bak` /* Partition `p0` */ because the .ibd file is missing. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2015-10-07T01:00:29.746268Z 2 [Warning] InnoDB: Cannot calculate statistics for table `test`.`t3_bak` /* Partition `p1` */ because the .ibd file is missing. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2015-10-07T01:00:29.746280Z 2 [Warning] InnoDB: Cannot calculate statistics for table `test`.`t3_bak` /* Partition `p2` */ because the .ibd file is missing. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2015-10-07T01:00:29.746301Z 2 [Warning] InnoDB: Cannot calculate statistics for table `test`.`t3_bak` /* Partition `p3` */ because the .ibd file is missing. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2015-10-07T01:00:29.746379Z 2 [Warning] InnoDB: Trying to access missing tablespace 23
2015-10-07 12:00:29 0x7f0e051d1700  InnoDB: Assertion failure in thread 139698192062208 in file ha_innopart.cc line 3526
InnoDB: Failing assertion: 0

+bt
#0  0x00007f0e04bd7771 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001721318 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:247
#2  0x0000000000dd6008 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f0e037db5d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f0e037dccc8 in __GI_abort () at abort.c:90
#6  0x0000000001a6f71b in ut_dbg_assertion_failed (expr=0x1fd1062 "0", file=0x1fd1708 "/git/mysql-server_dbg/storage/innobase/handler/ha_innopart.cc", line=3526) at /git/mysql-server_dbg/storage/innobase/ut/ut0dbg.cc:67
#7  0x000000000187fc2e in ha_innopart::info_low (this=0x7f0d3ab56030, flag=212, is_analyze=false) at /git/mysql-server_dbg/storage/innobase/handler/ha_innopart.cc:3526
#8  0x0000000001861122 in ha_innobase::info (this=0x7f0d3ab56030, flag=212) at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:13549
#9  0x000000000148859b in get_schema_tables_record (thd=0x7f0d39c1a000, tables=0x7f0d37e52c98, table=0x7f0d39d43030, res=false, db_name=0x7f0d39caacb8, table_name=0x7f0d39cec668) at /git/mysql-server_dbg/sql/sql_show.cc:4790
#10 0x0000000001485c2d in fill_schema_table_by_open (thd=0x7f0d39c1a000, is_show_fields_or_keys=false, table=0x7f0d39d43030, schema_table=0x29b8500 <schema_tables+1664>, orig_db_name=0x7f0d39caacb8, orig_table_name=0x7f0d39cec668, open_tables_state_backup=0x7f0e051cecd0, can_deadlock=true) at /git/mysql-server_dbg/sql/sql_show.cc:3793
#11 0x0000000001487359 in get_all_tables (thd=0x7f0d39c1a000, tables=0x7f0d39c2d490, cond=0x0) at /git/mysql-server_dbg/sql/sql_show.cc:4495
#12 0x00000000014954d9 in do_fill_table (thd=0x7f0d39c1a000, table_list=0x7f0d39c2d490, qep_tab=0x7f0d39c91e50) at /git/mysql-server_dbg/sql/sql_show.cc:7834
#13 0x00000000014958be in get_schema_tables_result (join=0x7f0d39c91770, executed_place=PROCESSED_BY_JOIN_EXEC) at /git/mysql-server_dbg/sql/sql_show.cc:7936
#14 0x000000000146e923 in JOIN::prepare_result (this=0x7f0d39c91770) at /git/mysql-server_dbg/sql/sql_select.cc:912
#15 0x00000000013d6704 in JOIN::exec (this=0x7f0d39c91770) at /git/mysql-server_dbg/sql/sql_executor.cc:125
#16 0x000000000146d4e2 in handle_query (thd=0x7f0d39c1a000, lex=0x7f0d39c1c210, result=0x7f0d39c91538, added_options=1342177280, removed_options=0) at /git/mysql-server_dbg/sql/sql_select.cc:184
#17 0x000000000161d5ed in Sql_cmd_insert_select::execute (this=0x7f0d39c2da28, thd=0x7f0d39c1a000) at /git/mysql-server_dbg/sql/sql_insert.cc:3130
#18 0x0000000001420065 in mysql_execute_command (thd=0x7f0d39c1a000) at /git/mysql-server_dbg/sql/sql_parse.cc:3277
#19 0x000000000142584f in mysql_parse (thd=0x7f0d39c1a000, parser_state=0x7f0e051d0680) at /git/mysql-server_dbg/sql/sql_parse.cc:5255
#20 0x000000000141b458 in dispatch_command (thd=0x7f0d39c1a000, com_data=0x7f0e051d0dc0, command=COM_QUERY) at /git/mysql-server_dbg/sql/sql_parse.cc:1272
#21 0x000000000141a10e in do_command (thd=0x7f0d39c1a000) at /git/mysql-server_dbg/sql/sql_parse.cc:852
#22 0x0000000001541c80 in handle_connection (arg=0x7f0d4dbc9200) at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#23 0x000000000174e31f in pfs_spawn_thread (arg=0x7f0dfabe8d20) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2178
#24 0x00007f0e04bd2df5 in start_thread (arg=0x7f0e051d1700) at pthread_create.c:308
#25 0x00007f0e0389c1ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

On Opt:

mysql> INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables;
ERROR 1406 (22001): Data too long for column 's' at row 69

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1(c1 INT,c2 CHAR(1)) PARTITION BY KEY(c1) PARTITIONS 4;
ALTER TABLE t1 DISCARD TABLESPACE;
RENAME TABLE t1 TO t3_bak;
create TABLE t1(s CHAR (1));
INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables;
[7 Oct 2015 6:37] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.7.8/5.7.10, 5.8.0 debug builds are affected.

Thanks,
Umesh
[7 Oct 2015 6:38] MySQL Verification Team
// 5.7.10 - only debug build affected

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78728 -v
bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.10 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.10/78728 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.10/78728/log.err 2>&1 &

-- build used

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: cat docs/INFO_SRC
commit: d938a21fec3d67ee00498a48ac20586bad147600
date: 2015-10-06 09:47:31 +0530
build-date: 2015-10-06 18:03:13 +0200
short: d938a21
branch: mysql-5.7

MySQL source 5.7.10

(gdb) bt
#0  0x00007f549f9ab771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000017e4280 in my_write_core (sig=6) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/mysys/stacktrace.c:247
#2  0x0000000000e505e2 in handle_fatal_signal (sig=6) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f549e3a55d7 in raise () from /lib64/libc.so.6
#5  0x00007f549e3a6cc8 in abort () from /lib64/libc.so.6
#6  0x0000000001b4dc57 in ut_dbg_assertion_failed (expr=0x2258feb "0",
    file=0x22598a8 "/export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/storage/innobase/handler/ha_innopart.cc", line=3545)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/storage/innobase/ut/ut0dbg.cc:67
#7  0x000000000195546c in ha_innopart::info_low (this=0x7f5428b24a60, flag=212, is_analyze=false)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/storage/innobase/handler/ha_innopart.cc:3545
#8  0x0000000001933f7c in ha_innobase::info (this=0x7f5428b24a60, flag=212) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/storage/innobase/handler/ha_innodb.cc:13691
#9  0x0000000001542010 in get_schema_tables_record (thd=0x7f5428000b70, tables=0x7f54297118f0, table=0x7f54280222d0, res=false, db_name=0x7f54280373b8, table_name=0x7f5429710070)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_show.cc:4885
#10 0x000000000153f64a in fill_schema_table_by_open (thd=0x7f5428000b70, mem_root=0x7f5472190410, is_show_fields_or_keys=false, table=0x7f54280222d0,
    schema_table=0x2d25f20 <schema_tables+1664>, orig_db_name=0x7f54280373b8, orig_table_name=0x7f5429710070, open_tables_state_backup=0x7f5472190470, can_deadlock=true)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_show.cc:3871
#11 0x0000000001540db0 in get_all_tables (thd=0x7f5428000b70, tables=0x7f54280069e0, cond=0x0) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_show.cc:4590
#12 0x000000000154f183 in do_fill_table (thd=0x7f5428000b70, table_list=0x7f54280069e0, qep_tab=0x7f54280502a0)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_show.cc:7970
#13 0x000000000154f56a in get_schema_tables_result (join=0x7f542804fbc0, executed_place=PROCESSED_BY_JOIN_EXEC)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_show.cc:8072
#14 0x0000000001527f8d in JOIN::prepare_result (this=0x7f542804fbc0) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_select.cc:909
#15 0x000000000148da46 in JOIN::exec (this=0x7f542804fbc0) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_executor.cc:124
#16 0x0000000001526b22 in handle_query (thd=0x7f5428000b70, lex=0x7f5428002cd0, result=0x7f542804f988, added_options=1342177280, removed_options=0)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_select.cc:184
#17 0x00000000016dd58a in Sql_cmd_insert_select::execute (this=0x7f5428006f78, thd=0x7f5428000b70)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_insert.cc:3178
#18 0x00000000014d874c in mysql_execute_command (thd=0x7f5428000b70, first_level=true) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_parse.cc:3359
#19 0x00000000014de0b7 in mysql_parse (thd=0x7f5428000b70, parser_state=0x7f5472191dd0) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_parse.cc:5357
#20 0x00000000014d390e in dispatch_command (thd=0x7f5428000b70, com_data=0x7f5472192e00, command=COM_QUERY)
    at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_parse.cc:1284
#21 0x00000000014d27a7 in do_command (thd=0x7f5428000b70) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/sql_parse.cc:852
#22 0x00000000015fed79 in handle_connection (arg=0x3d68c40) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/sql/conn_handler/connection_handler_per_thread.cc:295
#23 0x000000000189b064 in pfs_spawn_thread (arg=0x3dafd90) at /export/home2/pb2/build/sb_0-16667756-1444148157.1/mysqlcom-pro-5.7.10/storage/perfschema/pfs.cc:2192
#24 0x00007f549f9a6df5 in start_thread () from /lib64/libpthread.so.0
#25 0x00007f549e46660d in clone () from /lib64/libc.so.6
(gdb)
[7 Oct 2015 6:39] MySQL Verification Team
// 5.8.0 - only debug build affected

bin/mysql_install_db  --insecure --basedir=/export/umesh/server/binaries/mysql-advanced-5.8.0 --datadir=/export/umesh/server/binaries/mysql-advanced-5.8.0/78728 -v
bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/mysql-advanced-5.8.0 --datadir=/export/umesh/server/binaries/mysql-advanced-5.8.0/78728 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.8.0/78728/log.err 2>&1 &

--build used

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.8.0: cat docs/INFO_SRC
commit: ebe2d8c4433b27eefa69f31f638c0601e9d525e2
date: 2015-10-06 16:12:45 +0200
build-date: 2015-10-06 17:01:57 +0200
short: ebe2d8c
branch: mysql-trunk

MySQL source 5.8.0

(gdb) bt
#0  0x00007fc9501ac771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000017d872f in my_write_core (sig=6) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/mysys/stacktrace.cc:251
#2  0x00000000010131b1 in handle_fatal_signal (sig=6) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/signal_handler.cc:218
#3  <signal handler called>
#4  0x00007fc94eba65d7 in raise () from /lib64/libc.so.6
#5  0x00007fc94eba7cc8 in abort () from /lib64/libc.so.6
#6  0x0000000001ab668f in ut_dbg_assertion_failed (expr=0x2165777 "0",
    file=0x21660d0 "/export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/storage/innobase/handler/ha_innopart.cc", line=3513)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/storage/innobase/ut/ut0dbg.cc:67
#7  0x00000000018bcdfe in ha_innopart::info_low (this=0x7fc8d4b25ce0, flag=212, is_analyze=false)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/storage/innobase/handler/ha_innopart.cc:3513
#8  0x000000000189be92 in ha_innobase::info (this=0x7fc8d4b25ce0, flag=212)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/storage/innobase/handler/ha_innodb.cc:13758
#9  0x0000000000f46714 in get_schema_tables_record (thd=0x7fc8d4000b70, tables=0x7fc8d570edd8, table=0x7fc8d402c260, res=false, db_name=0x7fc8d40359d8, table_name=0x7fc8d570d558)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_show.cc:4979
#10 0x0000000000f43d79 in fill_schema_table_by_open (thd=0x7fc8d4000b70, mem_root=0x7fc92298e410, is_show_fields_or_keys=false, table=0x7fc8d402c260,
    schema_table=0x2c38a60 <schema_tables+1664>, orig_db_name=0x7fc8d40359d8, orig_table_name=0x7fc8d570d558, open_tables_state_backup=0x7fc92298e470, can_deadlock=true)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_show.cc:3984
#11 0x0000000000f454c1 in get_all_tables (thd=0x7fc8d4000b70, tables=0x7fc8d4006a00, cond=0x0) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_show.cc:4684
#12 0x0000000000f53845 in do_fill_table (thd=0x7fc8d4000b70, table_list=0x7fc8d4006a00, qep_tab=0x7fc8d402c070)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_show.cc:8064
#13 0x0000000000f53c2c in get_schema_tables_result (join=0x7fc8d402b990, executed_place=PROCESSED_BY_JOIN_EXEC)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_show.cc:8166
#14 0x0000000000f2b1ab in JOIN::prepare_result (this=0x7fc8d402b990) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:924
#15 0x0000000000ebbf78 in JOIN::exec (this=0x7fc8d402b990) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_executor.cc:139
#16 0x0000000000f29d4e in handle_query (thd=0x7fc8d4000b70, lex=0x7fc8d4002ce8, result=0x7fc8d402b758, added_options=1342177280, removed_options=0)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_select.cc:190
#17 0x000000000169f216 in Sql_cmd_insert_select::execute (this=0x7fc8d4006f98, thd=0x7fc8d4000b70)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_insert.cc:3225
#18 0x0000000000ee80a7 in mysql_execute_command (thd=0x7fc8d4000b70, first_level=true) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:3319
#19 0x0000000000eed8aa in mysql_parse (thd=0x7fc8d4000b70, parser_state=0x7fc92298fdd0) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:5304
#20 0x0000000000ee3397 in dispatch_command (thd=0x7fc8d4000b70, com_data=0x7fc922990e00, command=COM_QUERY)
    at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:1251
#21 0x0000000000ee2248 in do_command (thd=0x7fc8d4000b70) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:819
#22 0x00000000010036b7 in handle_connection (arg=0x3a51360) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/sql/conn_handler/connection_handler_per_thread.cc:296
#23 0x000000000180c658 in pfs_spawn_thread (arg=0x3ac79f0) at /export/home2/pb2/build/sb_0-16667071-1444144424.84/mysqlcom-pro-5.8.0-m17/storage/perfschema/pfs.cc:2211
#24 0x00007fc9501a7df5 in start_thread () from /lib64/libpthread.so.0
#25 0x00007fc94ec6760d in clone () from /lib64/libc.so.6
(gdb)
[29 Oct 2015 21:30] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.10, 5.8.0 releases, and here's the changelog entry:

An ALTER TABLE ... DISCARD TABLESPACE operation raised an invalid
assertion. 

Thank you for the bug report.
[18 Jun 2016 21:28] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0