[MDEV-473] Statistics: Server crashes in mysql_lock_merge if use_stat_tables is enabled and ANALYZE and ALTER TABLE are executed under lock Created: 2012-08-22  Updated: 2012-08-27  Resolved: 2012-08-27

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 10.0.0

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates

 Description   

 
#3  <signal handler called>
#4  0x00000000008b8e0e in mysql_lock_merge (a=0x0, b=0x1e99f20)
    at sql/lock.cc:609
#5  0x00000000005d40e5 in Locked_tables_list::reopen_tables (this=0x7f60ac05eb78,
    thd=0x7f60ac05c940) at sql/sql_base.cc:3621
#6  0x00000000006d4332 in mysql_alter_table (thd=0x7f60ac05c940, new_db=0x1e79ee8 "test",
    new_name=0x1e798e8 "t1", create_info=0x7f60b2d57d00, table_list=0x1e79920,
    alter_info=0x7f60b2d57e00, order_num=0, order=0x0, ignore=false, require_online=false)
    at sql/sql_table.cc:7193
#7  0x0000000000955c7b in Alter_table_statement::execute (this=0x1e79ff8, thd=0x7f60ac05c940)
    at sql/sql_alter.cc:106
#8  0x0000000000636091 in mysql_execute_command (thd=0x7f60ac05c940)
    at sql/sql_parse.cc:4459
#9  0x0000000000639197 in mysql_parse (thd=0x7f60ac05c940,
    rawbuf=0x1e79828 "alter table t1 add column a varchar(8)", length=38,
    parser_state=0x7f60b2d58600) at sql/sql_parse.cc:5736
#10 0x000000000062d019 in dispatch_command (command=COM_QUERY, thd=0x7f60ac05c940,
    packet=0x7f60ac11c421 "alter table t1 add column a varchar(8)", packet_length=38)
    at sql/sql_parse.cc:1055
#11 0x000000000062c2ec in do_command (thd=0x7f60ac05c940)
    at sql/sql_parse.cc:794
#12 0x0000000000730d51 in do_handle_one_connection (thd_arg=0x7f60ac05c940)
    at sql/sql_connect.cc:1253
#13 0x0000000000730814 in handle_one_connection (arg=0x7f60ac05c940)
    at sql/sql_connect.cc:1168
#14 0x0000000000abad87 in pfs_spawn_thread (arg=0x7f60ac0c8700)
    at storage/perfschema/pfs.cc:1015
#15 0x00007f60be7aca4f in start_thread () from /lib64/libpthread.so.0
#16 0x00007f60bd54182d in clone () from /lib64/libc.so.6

bzr version-info

revision-id: igor@askmonty.org-20120820190537-epzo04x3o58ccj6i
date: 2012-08-20 12:05:37 -0700
build-date: 2012-08-22 05:03:32 +0300
revno: 3362

Reproducible with MyISAM, Aria, InnoDB, MEMORY.
Not reproducible with use_stat_tables = NEVER.

Test case:

set use_stat_tables = complementary;
 
drop table if exists t1;
 
create table t1 (i int) engine=InnoDB;
lock table t1 write;
analyze table t1;
alter table t1 add column a varchar(8);
 
# Cleanup
drop table t1;
 



 Comments   
Comment by Sergei Petrunia [ 2012-08-23 ]

I've tried to create a similar situation with logging-to-tables part.
1. Started the server with --log-output=table --general_log=1
2. ran LOCK TABLE t1 WRITE;
3. ran SELECT * FROM t1;

The last statement got written to mysql.general_log. Apparently, the presence of "LOCK TABLE" does not affect MySQL's ability to lock mysql.general_log, write there, and unlock it.

Comment by Igor Babaev [ 2012-08-27 ]

The fix was pushed into maria-5.5-mwl248

Generated at Thu Feb 08 06:29:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.