Bug #25993 mysqldump crashes with merge table and -c option
Submitted: 31 Jan 2007 22:07 Modified: 9 Apr 2007 19:44
Reporter: Glynn Durham Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:5.0.27, 5.1.14, 5.2.0-falcon-alpha OS:Microsoft Windows (win32/Linux)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[31 Jan 2007 22:07] Glynn Durham
Description:
mysqldump crashes with merge table and -c option

How to repeat:
DROP DATABASE IF EXISTS foo;

CREATE DATABASE foo;

USE foo;

CREATE TABLE n (c int) ENGINE=MyISAM;

CREATE TABLE s (c int) ENGINE=MyISAM;

CREATE TABLE a (c int) ENGINE=merge UNION=(n, s);

# Now backup with:
#     shell>  mysqldump -uroot -padmin -c -B foo > foo.sql

####
#### Invocation crashes.
####

# Tested on:

#   mysqldump  Ver 10.10 Distrib 5.0.27, for Win32 (ia32)
#   mysqldump  Ver 10.12 Distrib 5.1.14-beta, for Win32 (ia32)
#   mysqldump  Ver 10.12 Distrib 5.2.0-falcon-alpha, for Win32 (ia32)

Suggested fix:
Make the invocation work without crashing.
[1 Feb 2007 11:27] Miguel Solorzano
Thank you for the bug report.

Starting program: /home/miguel/dbs/5.0/bin/mysqldump -uroot -c -B foo > foo.sql
[Thread debugging using libthread_db enabled]
[New Thread -1212832080 (LWP 5158)]

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1212832080 (LWP 5158)]
0xb7d780b5 in dynstr_append_mem (str=0x8057dfc, append=0x8054d5d ") VALUES ", length=9) at string.c:104
104           str->alloc_increment;
(gdb) bt full
#0  0xb7d780b5 in dynstr_append_mem (str=0x8057dfc, append=0x8054d5d ") VALUES ", length=9) at string.c:104
        new_length = 190988
        new_ptr = <value optimized out>
#1  0x0804ea72 in get_table_structure (table=0x806cb60 "a", db=0xbfb73b8d "foo", table_type=0xbfb72f18 "MRG_MyISAM", ignore_flag=0xbfb72351 "\001")
    at mysqldump.c:1993
<cut>
[21 Feb 2007 6:39] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/20246

ChangeSet@1.2418, 2007-02-21 10:39:36+04:00, ramil@mysql.com +3 -0
  Fix for bug #25993: mysqldump crashes with merge table and -c option
  
  opt_complete_insert was improperly used by accident.
  Use complete_insert flag instead.
[26 Mar 2007 7:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/22916

ChangeSet@1.2414, 2007-03-26 12:56:41+05:00, ramil@mysql.com +3 -0
  Fix for bug #25993: mysqldump crashes with merge table and -c option
    
  opt_complete_insert was improperly used by accident.
  Use complete_insert flag instead.
[6 Apr 2007 17:21] Bugs System
Pushed into 5.0.40
[6 Apr 2007 17:24] Bugs System
Pushed into 5.1.18-beta
[9 Apr 2007 19:44] Paul Dubois
Noted in 5.0.40, 5.1.18 changelogs.

mysqldump crashed for MERGE tables if the --complete-insert (-c)
option was given.