Bug #55455 concurrent drop database and show columns from table cause debug assertion
Submitted: 21 Jul 2010 18:07 Modified: 16 Sep 2010 10:24
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Locking Severity:S1 (Critical)
Version:5.1.49-debug OS:Any
Assigned to: CPU Architecture:Any

[21 Jul 2010 18:07] Shane Bester
Description:
Version: '5.1.48-enterprise-gpl-advanced-debug'  socket: ''  port: 3306  MySQL Enterprise Server - Advanced Edition Debug (GPL)
Crash1:

Assertion failed: table->db_stat, file .\sql_base.cc, line 2804
mysqld-debug.exe!my_sigabrt_handler()[mysqld.cc:2049]
mysqld-debug.exe!raise()[winsig.c:590]
mysqld-debug.exe!abort()[abort.c:71]
mysqld-debug.exe!_wassert()[assert.c:212]
mysqld-debug.exe!open_table()[sql_base.cc:2804]
mysqld-debug.exe!open_tables()[sql_base.cc:4621]
mysqld-debug.exe!open_normal_and_derived_tables()[sql_base.cc:5089
mysqld-debug.exe!fill_schema_show_cols_or_idxs()[sql_show.cc:3023]
mysqld-debug.exe!get_all_tables()[sql_show.cc:3316]
mysqld-debug.exe!get_schema_tables_result()[sql_show.cc:6139]
mysqld-debug.exe!JOIN::exec()[sql_select.cc:1838]
mysqld-debug.exe!mysql_select()[sql_select.cc:2511]
mysqld-debug.exe!handle_select()[sql_select.cc:269]
mysqld-debug.exe!execute_sqlcom_select()[sql_parse.cc:5075]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:2271]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5994]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1241]
mysqld-debug.exe!do_command()[sql_parse.cc:882]
mysqld-debug.exe!handle_one_connection()[sql_connect.cc:1134]
mysqld-debug.exe!pthread_start()[my_winthread.c:85]
mysqld-debug.exe!_callthreadstart()[thread.c:293]
mysqld-debug.exe!_threadstart()[thread.c:277]

Crash2:
Assertion failed: m_status == DA_ERROR, file g:\mysql-5.1.48-winbuild\mysql-advanced-gpl-debug-5.1.48-build\sql\sql_class.h, line 1177
mysqld-debug.exe!my_sigabrt_handler()[mysqld.cc:2049]
mysqld-debug.exe!raise()[winsig.c:590]
mysqld-debug.exe!abort()[abort.c:71]
mysqld-debug.exe!_wassert()[assert.c:212]
mysqld-debug.exe!Diagnostics_area::sql_errno()[sql_class.h:1177]
mysqld-debug.exe!select_send::abort()[sql_class.cc:1623]
mysqld-debug.exe!handle_select()[sql_select.cc:275]
mysqld-debug.exe!execute_sqlcom_select()[sql_parse.cc:5075]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:2271]
mysqld-debug.exe!sp_instr_stmt::exec_core()[sp_head.cc:2923]
mysqld-debug.exe!sp_lex_keeper::reset_lex_and_exec_core()[sp_head.cc:2744]
mysqld-debug.exe!sp_instr_stmt::execute()[sp_head.cc:2866]
mysqld-debug.exe!sp_head::execute()[sp_head.cc:1247]
mysqld-debug.exe!sp_head::execute_procedure()[sp_head.cc:1980]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:4415]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5994]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1241]
mysqld-debug.exe!do_command()[sql_parse.cc:882]
mysqld-debug.exe!handle_one_connection()[sql_connect.cc:1134]
mysqld-debug.exe!pthread_start()[my_winthread.c:85]
mysqld-debug.exe!_callthreadstart()[thread.c:293]
mysqld-debug.exe!_threadstart()[thread.c:277]

How to repeat:
concurrently run drop database and show columns from table. here are two SP's that can be used for this.

delimiter ;
set global sync_frm=0;
drop database if exists test1;
drop database if exists test;
create database if not exists test1;
create database if not exists test;
create table if not exists test.t1(a int)engine=innodb;
use test1;

drop procedure if exists p2;  
drop procedure if exists p1;
delimiter $
create procedure p1(a int)
begin
 declare i int default 0;
 declare continue handler for sqlexception begin end;
 repeat
  start transaction with consistent snapshot;
  show columns from test.t1;
  select * from information_schema.columns;
  set i=i+1;
 until i>a end repeat;
end $

create procedure p2(a int)
begin
 declare i int default 0;
 declare continue handler for sqlexception begin end;
 repeat
  drop database if exists test;
  create database if not exists test;
  create table if not exists test.t1(a int,b int,c int)engine=innodb;
  set i=i+1;
 until i>a end repeat;
end $

delimiter ;

call test1.p1(10000); #connection1
call test1.p2(10000); #connection2
[21 Jul 2010 18:29] MySQL Verification Team
this is tricky to repeat.  you might want to call p1 and p2 from more than 1 thread each, and on a debug server running on a fast multicore machine, although my workstation is quite the opposite..
[21 Jul 2010 19:31] Valeriy Kravchuk
Verified just as described with recent 5.1.49 on Mac OS X, with 2 threads running p1() and p2() concurrently for some time:

Assertion failed: (m_status == DA_ERROR), function unknown function, file sql_class.h, line 1177.
100721 22:25:15 - mysqld got signal 6 ;
[16 Aug 2010 10:24] Konstantin Osipov
Please try to repeat in 5.5. My guess is that you won't be able to.
Since the scenario is quite remote, suggest to set to "Won't fix" if not repeatable in 5.5.
[16 Sep 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[7 Jan 2015 10:32] MySQL Verification Team
no repeatable on modern versions.