crash / assertion in add_found_match_trig_cond
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Low
|
PrafullaT | ||
Dexter |
Fix Released
|
Low
|
PrafullaT |
Bug Description
There is a crash in add_found_
http://
http://
This happens with some regularity with the outer_join grammar, which focuses on creating some hairy multi-table (up to 15 or so) queries.
MySQL stacktrace:
...
# 2010-03-05T22:39:42 #0 0xb80d1430 in __kernel_vsyscall ()
# 2010-03-05T22:39:42 #0 0xb80d1430 in __kernel_vsyscall ()
# 2010-03-05T22:39:42 #1 0xb80aa1c8 in pthread_kill () from
/lib/tls/
# 2010-03-05T22:39:42 #2 0x0860acd9 in my_write_core (sig=11) at stacktrace.c:329
# 2010-03-05T22:39:42 #3 0x08282372 in handle_segfault (sig=11) at mysqld.cc:2569
# 2010-03-05T22:39:42 #4 <signal handler called>
# 2010-03-05T22:39:42 #5 0x082fee3f in add_found_
cond=0xa680c28, root_tab=0xa67f6b8) at sql_select.cc:6042
# 2010-03-05T22:39:42 #6 0x083107d7 in make_join_select (join=0xa4ac590,
select=0xa5ef3a0, cond=0xa4ac070) at sql_select.cc:6489
# 2010-03-05T22:39:42 #7 0x0831cb5a in JOIN::optimize (this=0xa4ac590) at
sql_select.cc:1115
# 2010-03-05T22:39:42 #8 0x0831ff67 in mysql_select (thd=0xa2de3d8,
rref_pointer_
conds=0xa4ac070, og_num=5, order=0x0, group=0xa4ac1a8, having=0x0,
# 2010-03-05T22:39:42 proc_param=0x0, select_
unit=0xa2df510, select_
# 2010-03-05T22:39:42 #9 0x0832597b in handle_select (thd=0xa2de3d8, lex=0xa2df4b4,
result=0xa4ac578, setup_tables_
# 2010-03-05T22:39:42 #10 0x08293015 in execute_
all_tables=
# 2010-03-05T22:39:42 #11 0x082952bc in mysql_execute_
sql_parse.cc:2248
# 2010-03-05T22:39:42 #12 0x0829ed0a in mysql_parse (thd=0xa2de3d8,
# 2010-03-05T22:39:42 inBuf=0xa2aec60 "SELECT STRAIGHT_JOIN MIN( table2 .
`col_int` ) AS field1 , table1 . `col_int_key` AS field2 , table3 . `col_int_key` AS
field3 , table1 . `pk` AS field4 , table2 . `pk` AS field5 , table1 . `col_in"...,
length=904, found_semicolon
# 2010-03-05T22:39:42 #13 0x0829fb2e in dispatch_command (command=COM_QUERY,
thd=0xa2de3d8,
# 2010-03-05T22:39:42 packet=0xa2c0b91 " SELECT STRAIGHT_JOIN MIN( table2 .
`col_int` ) AS field1 , table1 . `col_int_key` AS field2 , table3 . `col_int_key` AS
field3 , table1 . `pk` AS field4 , table2 . `pk` AS field5 , table1 . `col_"...,
packet_length=909) at sql_parse.cc:1233
# 2010-03-05T22:39:42 #14 0x082a1093 in do_command (thd=0xa2de3d8) at sql_parse.cc:874
# 2010-03-05T22:39:42 #15 0x0828c153 in handle_
sql_connect.cc:1127
# 2010-03-05T22:39:42 #16 0xb80a54ff in start_thread () from
/lib/tls/
# 2010-03-05T22:39:42 #17 0xb7f9449e in clone () from /lib/tls/
Related branches
- Patrick Crews: Approve
-
Diff: 521 lines (+361/-33)8 files modifieddrizzled/item.h (+5/-0)
drizzled/join.cc (+65/-20)
drizzled/nested_join.h (+10/-0)
drizzled/optimizer/range.cc (+5/-2)
drizzled/sql_select.cc (+8/-10)
drizzled/sql_select.h (+1/-1)
tests/r/optimizer.result (+141/-0)
tests/t/optimizer.test (+126/-0)
test case for Drizzle:
try to record the result for it and observe the crash
#/* Begin test case for query 0 */
--disable_warnings
DROP TABLE /*! IF EXISTS */ A;
DROP TABLE /*! IF EXISTS */ C;
DROP TABLE /*! IF EXISTS */ BB;
DROP TABLE /*! IF EXISTS */ B;
--enable_warnings
CREATE TABLE `A` (
`pk` int NOT NULL AUTO_INCREMENT,
`int_key` int DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `int_key` (`int_key`),
KEY `varchar_key` (`int_key`)
) ;
CREATE TABLE `C` (
`pk` int NOT NULL AUTO_INCREMENT,
`int_key` int DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `int_key` (`int_key`),
KEY `varchar_key` (`int_key`)
) AUTO_INCREMENT=21 ;
INSERT INTO `C` VALUES (1,2);
INSERT INTO `C` VALUES (2,9);
INSERT INTO `C` VALUES (3,3);
INSERT INTO `C` VALUES (4,9);
INSERT INTO `C` VALUES (5,NULL);
INSERT INTO `C` VALUES (6,9);
INSERT INTO `C` VALUES (7,3);
INSERT INTO `C` VALUES (8,8);
INSERT INTO `C` VALUES (9,8);
INSERT INTO `C` VALUES (10,53);
INSERT INTO `C` VALUES (11,0);
INSERT INTO `C` VALUES (12,5);
INSERT INTO `C` VALUES (13,166);
INSERT INTO `C` VALUES (14,3);
INSERT INTO `C` VALUES (15,0);
INSERT INTO `C` VALUES (16,1);
INSERT INTO `C` VALUES (17,9);
INSERT INTO `C` VALUES (18,5);
INSERT INTO `C` VALUES (19,6);
INSERT INTO `C` VALUES (20,2);
CREATE TABLE `BB` (
`pk` int NOT NULL AUTO_INCREMENT,
`int_key` int DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `int_key` (`int_key`),
KEY `varchar_key` (`int_key`)
) AUTO_INCREMENT=11 ;
INSERT INTO `BB` VALUES (10,8);
CREATE TABLE `B` (
`pk` int NOT NULL AUTO_INCREMENT,
`int_key` int DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `int_key` (`int_key`),
KEY `varchar_key` (`int_key`)
) AUTO_INCREMENT=2 ;
INSERT INTO `B` VALUES (1,7);
SELECT table1 .`int_key`
FROM BB table1 LEFT JOIN BB table2 LEFT JOIN B table4 JOIN C table5 ON table5
.`pk`
ON table4 .`pk` LEFT JOIN A JOIN BB table8 ON table8 .`pk` RIGHT JOIN BB table9
JOIN C table10 ON table10 .`int_key` ON table9 .`pk` ON table5 .`int_key` = table9
.`pk` RIGHT JOIN BB table11 LEFT JOIN C table12 JOIN BB table14 ON table12 .`pk`
=
table14 .`int_key` ON table11 .`int_key` = table12 .`pk` ON table5 .`int_key` =
table14 .`int_key` ON table2 .`pk`
WHERE table1 .`pk`
HAVING 55 ;
DROP TABLE A;
DROP TABLE C;
DROP TABLE BB;
DROP TABLE B;
#/* End of test case for query 0 */