Querying I_S.GLOBAL_TEMPORARY_TABLES or TEMPORARY_TABLES crashes threads working with temp tables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
High
|
Laurynas Biveinis | ||
5.1 |
Fix Released
|
High
|
Laurynas Biveinis | ||
5.5 |
Fix Released
|
High
|
Laurynas Biveinis | ||
5.6 |
Fix Released
|
High
|
Laurynas Biveinis |
Bug Description
Querying I_S.GLOBAL_
How to repeat:
create table t1(a int);
insert into t1 values(1), (2), (3);
insert into t1 select * from t1; /* repeat to make the table sufficient big */
alter table t1 add column b varchar(10);
/* in another session, while the previous ALTER TABLE is running */
select * from information_
Assertion failure which is the reason for the crash:
Assertion failed: (!table || !table->in_use || table->in_use == _current_thd()), function ha_thd, file /Users/
Backtrace:
#0 0x00007fff9020bce2 in __pthread_kill ()
#1 0x00007fff8bc7f7d2 in pthread_kill ()
#2 0x00007fff8bc70a7a in abort ()
#3 0x00007fff8bca35de in __assert_rtn ()
#4 0x000000010003b003 in handler::ha_thd () at /Users/
#5 0x000000010003b003 in handler:
#6 0x000000010003b003 in handler:
at /Users/
#7 0x00000001002a4205 in mysql_alter_table (thd=0x10104ec00, new_db=0x10d077038 "test", new_name=
alter_
#8 0x000000010030d8b1 in Alter_table_
at /Users/
#9 0x0000000100215fbc in mysql_execute_
#10 0x000000010021d30b in mysql_parse (thd=0x10104ec00, rawbuf=<value temporarily unavailable, due to optimizations>,
length=<value temporarily unavailable, due to optimizations>, parser_
at /Users/
#11 0x000000010021eaab in dispatch_command (command=COM_QUERY, thd=0x10104ec00, packet=<value temporarily unavailable, due to optimizations>, packet_length=39)
at /Users/
#12 0x000000010021f06e in do_command (thd=0x10104ec00) at /Users/
#13 0x0000000100308735 in do_handle_
at /Users/
#14 0x0000000100308864 in handle_
at /Users/
#15 0x00007fff8bc7d8bf in _pthread_start ()
#16 0x00007fff8bc80b75 in thread_start ()
I didn't verify on 5.1, but most likely it's also affected.
Related branches
- Alexey Kopytov (community): Approve
-
Diff: 113 lines (+53/-4)4 files modifiedPercona-Server/mysql-test/suite/innodb_plugin/r/percona_bug_951588.result (+12/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test (+29/-0)
Percona-Server/sql/handler.cc (+2/-0)
Percona-Server/sql/sql_show.cc (+10/-4)
- Alexey Kopytov (community): Approve
-
Diff: 120 lines (+52/-8)5 files modifiedPercona-Server/mysql-test/suite/innodb/r/percona_bug_951588.result (+12/-0)
Percona-Server/mysql-test/suite/innodb/t/percona_bug_951588.test (+29/-0)
Percona-Server/sql/handler.cc (+1/-0)
Percona-Server/sql/sql_show.cc (+10/-4)
Percona-Server/storage/innobase/handler/ha_innodb.cc (+0/-4)
summary: |
- I_S.GLOBAL_TEMPORARY_TABLES crashes debug builds on ALTER TABLE + Querying I_S.GLOBAL_TEMPORARY_TABLES or TEMPORARY_TABLES crashes threads + working with temp tables |
tags: | added: i-s-temp-tables |
Encountered similar problem with INFORMATION_ SCHEMA. TEMPORARY_ TABLES. (without GLOBAL_). The problem is that sql_show. cc:fill_ global_ temporary_ tables enumerates existing temp table handler objects. Then for each object the handler ::info method is called in store_temporary _table_ record that proceeds to overwrite current_thd, prebuilt->trx and possibly other fields of any operation in progress for that temp table handler.