truncate command with no binlog files causes segfault

Bug #382408 reported by Seppo Jaakola on 2009-06-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
High
Seppo Jaakola

Bug Description

Running 'truncate table' command at a cluster node, when binlog files are not used, will cause a segfault:
Howto reproduce:
1. Start a cluster with no log_bin option set.
2. create just any table, .e.g.: create table a (i int) engine=innodb;
3. issue: truncate table a:

The first node will crash with following stack trace:
{{{
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1496040560 (LWP 30006)]
0x085981a0 in my_b_safe_tell (info=0x881df80) at mf_iocache2.c:116
116 mf_iocache2.c: No such file or directory.
 in mf_iocache2.c
Current language: auto; currently c
(gdb) bt
#0 0x085981a0 in my_b_safe_tell (info=0x881df80) at mf_iocache2.c:116
#1 0x08359760 in Log_event::write_header (this=0xa6d418b4, file=0x881df80,
    event_data_length=60) at log_event.cc:848
#2 0x0835a5c7 in Query_log_event::write (this=0xa6d418b4, file=0x881df80)
    at log_event.cc:2233
#3 0x083254e8 in MYSQL_BIN_LOG::write (this=0x881dc60, event_info=0xa6d418b4)
    at log.cc:4192
#4 0x0822efa8 in THD::binlog_query (this=0xa464cd0,
    qtype=THD::STMT_QUERY_TYPE, query_arg=0xa46f208 "truncate table a",
    query_len=16, is_trans=false, suppress_use=false,
    killed_status_arg=THD::NOT_KILLED) at sql_class.cc:3776
#5 0x08316618 in mysql_delete (thd=0xa464cd0, table_list=0xa46f2a0,
    conds=0x0, order=0x0, limit=18446744073709551615, options=0,
    reset_auto_increment=true) at sql_delete.cc:409
#6 0x08316903 in mysql_truncate_by_delete (thd=0xa464cd0,
    table_list=0xa46f2a0) at sql_delete.cc:995
#7 0x08316fce in mysql_truncate (thd=0xa464cd0, table_list=0xa46f2a0,
    dont_send_ok=false) at sql_delete.cc:1111
#8 0x08262585 in mysql_execute_command (thd=0xa464cd0) at sql_parse.cc:3528
#9 0x0826a6de in mysql_parse (thd=0xa464cd0,
    inBuf=0xa46f208 "truncate table a", length=16, found_semicolon=0xa6d43034)
    at sql_parse.cc:6309
#10 0x0826bcb8 in dispatch_command (command=COM_QUERY, thd=0xa464cd0,
---Type <return> to continue, or q <return> to quit---
    packet=0xa4767c9 "truncate table a", packet_length=16) at sql_parse.cc:1353
#11 0x0826dcfb in do_command (thd=0xa464cd0) at sql_parse.cc:936
#12 0x0825575d in handle_one_connection (arg=0xa464cd0) at sql_connect.cc:1144
#13 0x00c54482 in start_thread () from /lib/i686/nosegneg/libpthread.so.0
#14 0x00bb0e9e in clone () from /lib/i686/nosegneg/libc.so.6
}}}

Changed in codership-mysql:
assignee: nobody → Seppo Jaakola (seppo-jaakola)
importance: Undecided → High
milestone: none → 0.6.1
status: New → In Progress
Seppo Jaakola (seppo-jaakola) wrote :

Fix committed in development branch. Passes manual regression tests.

Changed in codership-mysql:
status: In Progress → Fix Committed
Changed in codership-mysql:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers