1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where ((`test`.`t2_1024`.`b1` > '0') and (`test`.`t1_1024`.`a1` = substr(`test`.`t2_1024`.`b1`,1,1024)))
select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0');
left(a1,7) left(a2,7)
1 - 01x 2 - 01x
1 - 02x 2 - 02x
explain extended select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where ((`test`.`t2_1025`.`b1` > '0') and (`test`.`t1_1025`.`a1` = substr(`test`.`t2_1025`.`b1`,1,1025)))
select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0');
left(a1,7) left(a2,7)
1 - 01x 2 - 01x
1 - 02x 2 - 02x
explain extended select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
...
...
@@ -1617,4 +1619,81 @@ GROUP BY 1 , 2;
a c
1 2
drop table t1,t2,t3;
#
# BUG#836523: Crash in JOIN::get_partial_cost_and_fanout with semijoin+materialization
#
CREATE TABLE t1 (a varchar(1));
INSERT INTO t1 VALUES ('a'),('a');
CREATE TABLE t2 (a varchar(1));
CREATE TABLE t3 (a int);
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (a varchar(1));
INSERT INTO t4 VALUES ('a'),('a');
SELECT t1.a
FROM t1
WHERE t1.a IN (
SELECT t2.a
FROM t2, t3
)
HAVING a IN (
SELECT a
FROM t4
);
a
DROP TABLE t1, t2, t3, t4;
#
# BUG#836507: Crash in setup_sj_materialization_part1() with semijoin+materialization
#
CREATE TABLE t1 (a int) ;
INSERT IGNORE INTO t1 VALUES (1),(1);
CREATE TABLE t2 (a int);
INSERT INTO t2 VALUES (1);
CREATE TABLE t3 (a int);
CREATE TABLE t4 (a int);
INSERT INTO t4 VALUES (2),(2);
CREATE TABLE t5 (a int);
INSERT INTO t5 VALUES (1);
SELECT * FROM t1
WHERE (a) IN (
SELECT t5.a
FROM (
t2
LEFT JOIN ( t3 , t4 )
ON 1 = 1
)
JOIN t5
);
a
1
1
DROP TABLE t1,t2,t3,t4,t5;
#
# BUG#836532: Crash in Item_equal_fields_iterator::get_curr_field with semijoin+materialization
#
CREATE TABLE t2 (a int);
INSERT INTO t2 VALUES ('a'),('a');
Warnings:
Warning 1366 Incorrect integer value: 'a' for column 'a' at row 1
Warning 1366 Incorrect integer value: 'a' for column 'a' at row 2