Bug #50558 show full columns + flush table crashes
Submitted: 22 Jan 2010 20:26 Modified: 30 Dec 2014 19:10
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Locking Severity:S1 (Critical)
Version:5.5.99-m3-debug OS:Windows (xp)
Assigned to: CPU Architecture:Any

[22 Jan 2010 20:26] Shane Bester
Description:
I branched mysql-next-mr-bugfixing and built debug server that crashes

mysqld.exe!Field_varstring::sql_type()[field.cc:7038]
mysqld.exe!get_schema_column_record()[sql_show.cc:3985]
mysqld.exe!fill_schema_show_cols_or_idxs()[sql_show.cc:2950]
mysqld.exe!get_all_tables()[sql_show.cc:3267]
mysqld.exe!get_schema_tables_result()[sql_show.cc:6519]
mysqld.exe!JOIN::exec()[sql_select.cc:1796]
mysqld.exe!mysql_select()[sql_select.cc:2468]
mysqld.exe!handle_select()[sql_select.cc:271]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:4953]
mysqld.exe!mysql_execute_command()[sql_parse.cc:2135]
mysqld.exe!sp_instr_stmt::exec_core()[sp_head.cc:2952]
mysqld.exe!sp_lex_keeper::reset_lex_and_exec_core()[sp_head.cc:2774]
mysqld.exe!sp_instr_stmt::execute()[sp_head.cc:2889]
mysqld.exe!sp_head::execute()[sp_head.cc:1261]
mysqld.exe!sp_head::execute_procedure()[sp_head.cc:2005]
mysqld.exe!mysql_execute_command()[sql_parse.cc:4291]
mysqld.exe!mysql_parse()[sql_parse.cc:5989]
mysqld.exe!dispatch_command()[sql_parse.cc:1140]
mysqld.exe!do_command()[sql_parse.cc:810]
mysqld.exe!do_handle_one_connection()[sql_connect.cc:1172]
mysqld.exe!handle_one_connection()[sql_connect.cc:1112]
mysqld.exe!pfs_spawn_thread()[pfs.cc:1011]
mysqld.exe!pthread_start()[my_winthread.c:61]
mysqld.exe!_callthreadstartex()[threadex.c:348]
mysqld.exe!_threadstartex()[threadex.c:331]
kernel32.dll!FlsSetValue()

Exact revision was this:
[sbester@box1 mysql-next-mr-bugfixing]$ bzr log |head -n 20
------------------------------------------------------------
revno: 2972
committer: Alexander Nozdrin <alik@sun.com>
branch nick: mysql-next-mr-bugfixing
timestamp: Fri 2010-01-22 11:20:13 +0300
message:
  Auto-merge from mysql-next-mr.

How to repeat:
start mysqld with --performance-schema=1

concurrency bug.  in one thread flush a table. in another thread show full columns:

delimiter $
drop procedure if exists `p1` $
create procedure `p1`(`a` int)
begin
  declare `i` int default '0';
  repeat
    show full columns from `performance_schema`.`events_waits_current`;
    flush table `performance_schema`.`events_waits_current`;
    set `i` = `i` + 1;
  until `i` > `a` end repeat;

end $

delimiter ;

Now, start two or more connections and run this SP:

1) mysql -uroot test -e "call p1(10000)" > out1.txt
2) mysql -uroot test -e "call p1(10000)" > out.txt
[23 Jan 2010 1:09] MySQL Verification Team
sorry, this is NOT performance_schema related.  It seems 5.5 is just more broken than I thought.  I repeated it with normal tables also, in 3+ threads (was a bit harder):

delimiter $
drop table if exists t1 $
create table t1(a varchar(255))engine=memory$
insert into t1 values (),(),()$
drop procedure if exists `p1` $
create procedure `p1`(`a` int)
begin
  declare `i` int default '0';
  repeat
    show full columns from `t1`;
    flush table `t1`;
    set `i` = `i` + 1;
  until `i` > `a` end repeat;

end $

delimiter ;
[25 Jan 2010 12:02] MySQL Verification Team
I couldn't repeat on Windows Vista X64 (using older tables it crashed with drop procedure..command) however with fresh tables so far I was not able to repeat:

:\mysql>bin\mysqld --standalone --console --performance-schema=1
00125  9:47:18 [Note] Buffered information: Performance schema enabled.

00125  9:47:18 [Note] Plugin 'FEDERATED' is disabled.
nnoDB: The InnoDB memory heap is disabled
nnoDB: Mutexes and rw_locks use Windows interlocked functions
nnoDB: The first specified data file .\ibdata1 did not exist:
nnoDB: a new database to be created!
00125  9:47:18  InnoDB: Setting file .\ibdata1 size to 10 MB
nnoDB: Database physically writes the file full: wait...
00125  9:47:18  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
nnoDB: Setting log file .\ib_logfile0 size to 5 MB
nnoDB: Database physically writes the file full: wait...
00125  9:47:19  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
nnoDB: Setting log file .\ib_logfile1 size to 5 MB
nnoDB: Database physically writes the file full: wait...
nnoDB: Doublewrite buffer not found: creating new
nnoDB: Doublewrite buffer created
nnoDB: Creating foreign key constraint system tables
nnoDB: Foreign key constraint system tables created
00125  9:47:19 InnoDB Plugin 1.0.6 started; log sequence number 0
00125  9:47:20 [Note] Event Scheduler: Loaded 0 events
00125  9:47:20 [Note] bin\mysqld: ready for connections.
ersion: '5.5.99-m3-Win X64-debug'  socket: ''  port: 3306  Source distribution
[25 Jan 2010 14:27] MySQL Verification Team
try call p1(1000000)  and 20 threads then .... or try performance_schema tables, they seemed easier to crash server than 'normal' tables.
[25 Jan 2010 22:05] Sveta Smirnova
Not repeatable on Linux for me with mysql-next-mr-bugfixing revision 2976
[25 Jul 2010 16:55] Valeriy Kravchuk
Please, check if this is still repeatable on current mysql-trunk and/or mysql-next-mr trees in your environment.
[25 Aug 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".
[30 Dec 2014 19:10] MySQL Verification Team
Cannot repeat on 5.6.20, so closing this bug.