Bug #12173 SHOW CREATE TABLE crashes the server
Submitted: 26 Jul 2005 9:47 Modified: 29 Jul 2005 9:37
Reporter: Andrey Hristov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.11-beta 20050726 OS:Linux (Linux)
Assigned to: Alexey Botchkov CPU Architecture:Any

[26 Jul 2005 9:47] Andrey Hristov
Description:
(gdb) bt
#0  0x083161b0 in decimal2string (from=0xbfffd7b0, to=0xbfffd9a0 '0' <repeats 200 times>..., to_len=0xbfffd778, fixed_precision=-1073741824,
    fixed_decimals=-9825, filler=48 '0') at decimal.c:415
#1  0x081fffac in my_decimal2string (mask=30, d=0xbfffd7b0, fixed_prec=30, fixed_dec=1, filler=48 '0', str=0xbfffd900) at sql_string.h:88
#2  0x080b4cf7 in Field_new_decimal::val_str (this=0x8624ae8, val_buffer=0xbfffd900, val_ptr=0xbfffd900) at field.cc:2547
#3  0x081bdb6c in store_create_info (thd=0x30303030, table_list=0x30303030, packet=0x30303030) at field.h:106

How to repeat:
create table tb1 (
f1 char(100), 
f2 char binary, 
f3 char ascii, 
f12 binary, 
f13 tinyint, 
f14 tinyint unsigned, 
f15 tinyint zerofill, 
f16 tinyint unsigned zerofill, 
f17 smallint, 
f18 smallint unsigned,  
f19 smallint zerofill, 
f20 smallint unsigned zerofill, 
f21 mediumint, 
f22 mediumint unsigned, 
f23 mediumint zerofill, 
f24 mediumint unsigned zerofill, 
f25 int, 
f26 int unsigned, 
f27 int zerofill, 
f28 int unsigned zerofill, 
f29 bigint, 
f30 bigint unsigned, 
f31 bigint zerofill, 
f32 bigint unsigned zerofill, 
f33 decimal not null DEFAULT 0, 
f34 decimal unsigned not null DEFAULT 0, 
f35 decimal zerofill not null DEFAULT 0, 
f36 decimal unsigned zerofill not null DEFAULT 0, 
f37 decimal (0) not null DEFAULT 0, 
f38 decimal (64) not null DEFAULT 0, 
f39 decimal (0) unsigned not null DEFAULT 0, 
f40 decimal (64) unsigned not null DEFAULT 0, 
f41 decimal (0) zerofill not null DEFAULT 0, 
f42 decimal (64) zerofill not null DEFAULT 0, 
f43 decimal (0) unsigned zerofill not null DEFAULT 0, 
f44 decimal (64) unsigned zerofill not null DEFAULT 0, 
f45 decimal (0,0) not null DEFAULT 0, 
f46 decimal (30,30) not null DEFAULT 0, 
f47 decimal (0,0) unsigned not null DEFAULT 0, 
f48 decimal (30,30) unsigned not null DEFAULT 0, 
f49 decimal (0,0) zerofill not null DEFAULT 0, 
f50 decimal (30,30) zerofill not null DEFAULT 0, 
f51 decimal (0,0) unsigned zerofill not null DEFAULT 0, 
f52 decimal (30,30) unsigned zerofill not null DEFAULT 0, 
f53 numeric not null DEFAULT 99, 
f54 numeric unsigned not null DEFAULT 99, 
f55 numeric zerofill not null DEFAULT 99, 
f56 numeric unsigned zerofill not null DEFAULT 99, 
f57 numeric (0) not null DEFAULT 99, 
f58 numeric (64) not null DEFAULT 99
);

mysql>show create table tb1;
[26 Jul 2005 9:48] Andrey Hristov
(wasn't confirmed with 5.0.9 by Valeriy Kravchuk)
[26 Jul 2005 10:58] Georg Richter
debug output:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1442757552 (unknown thread_db state 1)]
0x08284bc8 in mysql_alter_table (thd=Cannot access memory at address 0x8
) at sql_table.cc:3065
/home/georg/work/mysql/prod/mysql-5.0/sql/sql_table.cc:3065:92955:beg:0x8284bc8
(gdb) bt
#0  0x08284bc8 in mysql_alter_table (thd=Cannot access memory at address 0x8
) at sql_table.cc:3065
Cannot access memory at address 0x4
[29 Jul 2005 9:31] 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/internals/27710
[29 Jul 2005 9:37] Alexey Botchkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html