| Bug #12392 | Server crashes in complex join query | ||
|---|---|---|---|
| Submitted: | 4 Aug 2005 22:03 | Modified: | 12 Aug 2005 19:36 |
| Reporter: | Mark Matthews | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 5.0.11 (and 4.1.12) | OS: | Linux (Fedora Core 3) |
| Assigned to: | Igor Babaev | CPU Architecture: | Any |
[4 Aug 2005 22:03]
Mark Matthews
[4 Aug 2005 22:16]
MySQL Verification Team
Thank you for the bug report.
050804 19:14:09 [Note] /home/miguel/dbs/5.0/libexec/mysqld: ready for connections.
Version: '5.0.12-beta-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution
[New Thread 1132370864 (LWP 18826)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1132370864 (LWP 18826)]
0x081522aa in String::length (this=0x0) at sql_string.h:82
82 inline uint32 length() const { return str_length;}
(gdb) backtrace full
#0 0x081522aa in String::length (this=0x0) at sql_string.h:82
No locals.
#1 0x081cbef4 in sortcmp (s=0x8e3eb30, t=0x0, cs=0x8791e00) at sql_string.cc:722
No locals.
#2 0x081839dc in cmp_item_sort_string_in_static::compare (this=0x8e6ce40, c=0x8e6cc70) at item_cmpfunc.h:811
cmp = (cmp_item_string *) 0x8e6cc70
#3 0x0817c878 in cmp_item_row::compare (this=0x8e6cc4c, c=0x8e6cc24) at item_cmpfunc.cc:2116
res = 1132365960
i = 0
cmp = (cmp_item_row *) 0x8e6cc24
#4 0x0817b201 in cmp_row (cmp_arg=0x0, a=0x8e6cc4c, b=0x8e6cc24) at item_cmpfunc.cc:1805
No locals.
#5 0x0817b2c5 in in_vector::find (this=0x8e6cc08, item=0x8e3e800) at item_cmpfunc.cc:1833
mid = 1
res = 72
result = (byte *) 0x8e6cc24 "H×Z\bà\ry\b`Ìæ\b\003"
start = 0
end = 1
#6 0x0817ce59 in Item_func_in::val_int (this=0x8e3edd0) at item_cmpfunc.cc:2263
<cut>
[5 Aug 2005 7:43]
Heikki Tuuri
Crashes also with MyISAM type tables.
[8 Aug 2005 22:36]
Igor Babaev
We can easily get a crash with the following example:
mysql> CREATE TABLE t1 (a char(5), b char(5));
Query OK, 0 rows affected (0.26 sec)
mysql> INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb'));
ERROR 2013 (HY000): Lost connection to MySQL server during query
[8 Aug 2005 23:51]
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/28042
[12 Aug 2005 8:45]
Igor Babaev
ChangeSet
1.2367 05/08/08 16:51:12 igor@rurik.mysql.com +3 -0
subselect.test, subselect.result:
Added a test case for bug #12392.
item_cmpfunc.cc:
Fixed bug #12392.
Missing handling of rows containing NULL components
when evaluating IN predicates caused a crash.
The fix will appear in 4.1.14 and 5.0.12.
[12 Aug 2005 19:36]
Paul DuBois
Noted in 4.1.14, 5.0.12 changelogs.
