INSERT INTO t4 VALUES (0,'RUS','Belorussian'),(0,'USA','Portuguese');
CREATE TABLE t5 ( f2 int) ;
CREATE TABLE t6 ( f4 varchar(3));
INSERT INTO t6 VALUES ('RUS'),('USA');
set @tmp_mjs_861147= @@max_join_size;
SET max_join_size=10;
set @tmp_os_861147= @@optimizer_switch;
set @@optimizer_switch='semijoin=on,materialization=on';
SELECT *
FROM t1
WHERE ( 1 , 3 ) IN (
SELECT t2.f1 , MAX( t3.f3 )
FROM t2
JOIN t3
WHERE t3.f4 IN (
SELECT t4.f5
FROM t4
STRAIGHT_JOIN t5
WHERE t4.f4 < t2.f5
)
) AND ( 'p' , 'k' ) IN (
SELECT f4 , f4 FROM t6
);
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
INSERT INTO t4 VALUES (0,'RUS','Belorussian'),(0,'USA','Portuguese');
CREATE TABLE t5 ( f2 int) ;
CREATE TABLE t6 ( f4 varchar(3));
INSERT INTO t6 VALUES ('RUS'),('USA');
set @tmp_mjs_861147= @@max_join_size;
SET max_join_size=10;
set @tmp_os_861147= @@optimizer_switch;
set @@optimizer_switch='semijoin=on,materialization=on';
SELECT *
FROM t1
WHERE ( 1 , 3 ) IN (
SELECT t2.f1 , MAX( t3.f3 )
FROM t2
JOIN t3
WHERE t3.f4 IN (
SELECT t4.f5
FROM t4
STRAIGHT_JOIN t5
WHERE t4.f4 < t2.f5
)
) AND ( 'p' , 'k' ) IN (
SELECT f4 , f4 FROM t6
);
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
set max_join_size= @tmp_mjs_861147;
set optimizer_switch= @tmp_os_861147;
DROP TABLE t1,t2,t3,t4,t5,t6;
set optimizer_switch=@subselect_sj_tmp;
set optimizer_switch=@subselect_sj_tmp;
#
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off