truncate command with no binlog files causes segfault

Bug #382408 reported by Seppo Jaakola on 2009-06-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
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
#2 0x0835a5c7 in Query_log_event::write (this=0xa6d418b4, file=0x881df80)
#3 0x083254e8 in MYSQL_BIN_LOG::write (this=0x881dc60, event_info=0xa6d418b4)
#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
#5 0x08316618 in mysql_delete (thd=0xa464cd0, table_list=0xa46f2a0,
    conds=0x0, order=0x0, limit=18446744073709551615, options=0,
    reset_auto_increment=true) at
#6 0x08316903 in mysql_truncate_by_delete (thd=0xa464cd0,
    table_list=0xa46f2a0) at
#7 0x08316fce in mysql_truncate (thd=0xa464cd0, table_list=0xa46f2a0,
    dont_send_ok=false) at
#8 0x08262585 in mysql_execute_command (thd=0xa464cd0) at
#9 0x0826a6de in mysql_parse (thd=0xa464cd0,
    inBuf=0xa46f208 "truncate table a", length=16, found_semicolon=0xa6d43034)
#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
#11 0x0826dcfb in do_command (thd=0xa464cd0) at
#12 0x0825575d in handle_one_connection (arg=0xa464cd0) at
#13 0x00c54482 in start_thread () from /lib/i686/nosegneg/
#14 0x00bb0e9e in clone () from /lib/i686/nosegneg/

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