summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-09-25 09:00:01 -0700
committerIgor Babaev <igor@askmonty.org>2010-09-25 09:00:01 -0700
commit0f1b52c6638a0a7a67e8b5945521c429740dcf11 (patch)
tree73d16a025f3a84fa277f61bcc8983a8d786b7b08
parent992ee8e1c0e36da0058e1d31c432a45a6cbd80e3 (diff)
downloadmariadb-git-0f1b52c6638a0a7a67e8b5945521c429740dcf11.tar.gz
Changed the test case for bug #53161 to make it independent on
the setting of optimizer switch for table elimination.
-rw-r--r--mysql-test/r/join_outer.result9
-rw-r--r--mysql-test/t/join_outer.test9
2 files changed, 5 insertions, 13 deletions
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 10425e6082a..8c9c121c9be 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1423,11 +1423,9 @@ insert into t1 values (1000, 1), (1001, 1);
insert into t2 values (2000, 2), (2001, 2);
insert into t3 values (3000, 3), (3001, 2);
insert into t4 values (4000), (4001);
-set @save_optimizer_switch=@@optimizer_switch;
-set @@optimizer_switch='table_elimination=off';
explain extended
select t2.pk,
-(select t3.pk
+(select t3.pk+if(isnull(t4.pk),0,t4.pk)
from t3 left join t4 on t4.pk=t3.pk
where t3.pk=t2.pk+1000 limit 1 ) as t
from t1,t2
@@ -1440,9 +1438,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 test.t3.pk 1 100.00 Using where; Using index
Warnings:
Note 1276 Field or reference 'test.t2.pk' of SELECT #2 was resolved in SELECT #1
-Note 1003 select `test`.`t2`.`pk` AS `pk`,(select `test`.`t3`.`pk` from `test`.`t3` left join `test`.`t4` on((`test`.`t4`.`pk` = `test`.`t3`.`pk`)) where (`test`.`t3`.`pk` = (`test`.`t2`.`pk` + 1000)) limit 1) AS `t` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`pk` = (`test`.`t1`.`pk` + 1000)) and (`test`.`t1`.`pk` > 1000)) group by `test`.`t2`.`pk`
+Note 1003 select `test`.`t2`.`pk` AS `pk`,(select (`test`.`t3`.`pk` + if(isnull(`test`.`t4`.`pk`),0,`test`.`t4`.`pk`)) from `test`.`t3` left join `test`.`t4` on((`test`.`t4`.`pk` = `test`.`t3`.`pk`)) where (`test`.`t3`.`pk` = (`test`.`t2`.`pk` + 1000)) limit 1) AS `t` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`pk` = (`test`.`t1`.`pk` + 1000)) and (`test`.`t1`.`pk` > 1000)) group by `test`.`t2`.`pk`
select t2.pk,
-(select t3.pk
+(select t3.pk+if(isnull(t4.pk),0,t4.pk)
from t3 left join t4 on t4.pk=t3.pk
where t3.pk=t2.pk+1000 limit 1 ) as t
from t1,t2
@@ -1450,6 +1448,5 @@ where t2.pk=t1.pk+1000 and t1.pk>1000
group by t2.pk;
pk t
2001 3001
-set @@optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3,t4;
End of 5.1 tests
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 5694692dd47..cbc65d66624 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1010,12 +1010,9 @@ insert into t2 values (2000, 2), (2001, 2);
insert into t3 values (3000, 3), (3001, 2);
insert into t4 values (4000), (4001);
-set @save_optimizer_switch=@@optimizer_switch;
-set @@optimizer_switch='table_elimination=off';
-
explain extended
select t2.pk,
- (select t3.pk
+ (select t3.pk+if(isnull(t4.pk),0,t4.pk)
from t3 left join t4 on t4.pk=t3.pk
where t3.pk=t2.pk+1000 limit 1 ) as t
from t1,t2
@@ -1023,15 +1020,13 @@ select t2.pk,
group by t2.pk;
select t2.pk,
- (select t3.pk
+ (select t3.pk+if(isnull(t4.pk),0,t4.pk)
from t3 left join t4 on t4.pk=t3.pk
where t3.pk=t2.pk+1000 limit 1 ) as t
from t1,t2
where t2.pk=t1.pk+1000 and t1.pk>1000
group by t2.pk;
-set @@optimizer_switch=@save_optimizer_switch;
-
drop table t1,t2,t3,t4;
--echo End of 5.1 tests