Bug #23753 server crash on SELECT if underlying table has different index definition
Submitted: 29 Oct 2006 16:44 Modified: 6 Feb 2007 12:08
Reporter: Sergey Vojtovich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Merge storage engine Severity:S3 (Non-critical)
Version:4.1/5.0/5.1BK OS:Linux (Suse 10.0 32-bit)
Assigned to: Sergey Vojtovich CPU Architecture:Any

[29 Oct 2006 16:44] Sergey Vojtovich
Description:
Server crash on SELECT if underlying table has different index definition.

How to repeat:
CREATE TABLE tm1(a TEXT, b INT, KEY(a(200))) ENGINE=MERGE UNION=(t1,t2);
CREATE TABLE t1(a TEXT, b INT, KEY(a(200)));
CREATE TABLE t2(a TEXT, b INT, KEY(b));
INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaa', 0x7fffffff);
INSERT INTO t2 VALUES('aaaaaaaaaaaaaaaaaaaa', 0x7fffffff);
SELECT * FROM tm1 WHERE
a='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
DROP TABLE tm1, t1, t2;
[29 Oct 2006 17:25] MySQL Verification Team
Thank you for the bug report. The crash happens with the last command: drop
table after memory allocation issues:

libexec/mysqld: ready for connections.
Version: '4.1.22-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'mi_open.c:657'
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'mi_open.c:657'
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'mi_open.c:657'
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'my_alloc.c:288'
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'sql_select.cc:4111'
<cut>
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do 
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8caf110 = DROP TABLE tm1, t1, t2
thd->thread_id=2

061029 14:22:42 [Note] libexec/mysqld: ready for connections.
Version: '5.0.27-debug'  socket: '/tmp/mysql.sock'  port: 3307  Source distribution
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'array.c:236'
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'my_alloc.c:353'
Error: Memory allocated at mulalloc.c:51 was overrun, discovered at 'opt_range.cc:892'
<cut>
[6 Feb 2007 12:08] Sergey Vojtovich
This bug is fixed in 4.1.23, 5.0.36, 5.1.15. No changelog entry needed,
since it will be documented as WL#3567. The following related bugs are also
fixed by the WL task: bug#457, bug#23750, bug#23751, bug#23752, bug#23753.