Browse Source

LP BUG#715759

Pushing test case only. The bug itself was fixed by the
combined patches for LP BUG#717577 and LP BUG#776274.
pull/374/head
unknown 15 years ago
parent
commit
0278b06e6b
  1. 18
      mysql-test/r/subselect4.result
  2. 20
      mysql-test/t/subselect4.test

18
mysql-test/r/subselect4.result

@ -1700,3 +1700,21 @@ WHERE (alias2.f10 = alias1.f11) AND (alias1.f11 OR alias1.f3 = 50 AND alias1.f10
f12 f13
set @@optimizer_switch=@save_optimizer_switch;
drop table t1, t2;
#
# LP BUG#715759 Wrong result with in_to_exists=on in maria-5.3-mwl89
#
set @save_optimizer_switch=@@optimizer_switch;
CREATE TABLE t1 (a1 int, a2 int) ;
INSERT INTO t1 VALUES (1, 2);
INSERT INTO t1 VALUES (3, 4);
CREATE TABLE t2 (b1 int, b2 int) ;
INSERT INTO t2 VALUES (1, 2);
SET @@optimizer_switch = 'in_to_exists=on,materialization=off,semijoin=off';
EXPLAIN SELECT * FROM t1 WHERE a1 IN (SELECT b1 FROM t2 WHERE b1 = b2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
SELECT * FROM t1 WHERE a1 IN (SELECT b1 FROM t2 WHERE b1 = b2);
a1 a2
set @@optimizer_switch=@save_optimizer_switch;
drop table t1, t2;

20
mysql-test/t/subselect4.test

@ -1370,3 +1370,23 @@ WHERE ( f12 ) IN (
set @@optimizer_switch=@save_optimizer_switch;
drop table t1, t2;
--echo #
--echo # LP BUG#715759 Wrong result with in_to_exists=on in maria-5.3-mwl89
--echo #
set @save_optimizer_switch=@@optimizer_switch;
CREATE TABLE t1 (a1 int, a2 int) ;
INSERT INTO t1 VALUES (1, 2);
INSERT INTO t1 VALUES (3, 4);
CREATE TABLE t2 (b1 int, b2 int) ;
INSERT INTO t2 VALUES (1, 2);
SET @@optimizer_switch = 'in_to_exists=on,materialization=off,semijoin=off';
EXPLAIN SELECT * FROM t1 WHERE a1 IN (SELECT b1 FROM t2 WHERE b1 = b2);
SELECT * FROM t1 WHERE a1 IN (SELECT b1 FROM t2 WHERE b1 = b2);
set @@optimizer_switch=@save_optimizer_switch;
drop table t1, t2;
Loading…
Cancel
Save