MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:June 11 2010 12:27pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (guilhem:3192) Bug#50358
Bug#51018
View as plain text  
#At file:///home/mysql_src/bzrrepos_new/opt-back-53970-otherfix/ based on revid:guilhem@stripped

 3192 Guilhem Bichot	2010-06-11
      Fix for BUG#50358 "semijoin execution of subquery with outerjoin yields wrong result"
      and BUG#51018 "Batched key access gives wrong results for SELECT with semijoin and NULL":
      semijoin materialization was not fully disabled when doing join buffering.
     @ mysql-test/r/subselect3.result
        those plans accidentally had join buffering enabled for the non-first
        inner tables in a semijoin materialization nest
     @ mysql-test/r/subselect3_jcl6.result
        those plans accidentally had join buffering enabled for the non-first
        inner tables in a semijoin materialization nest.
        The test where one 256,67,NULL line disappears, is exactly the test for BUG#51018.
     @ mysql-test/r/subselect4.result
        those plans accidentally had join buffering enabled for the non-first
        inner tables in a semijoin materialization nest
     @ mysql-test/r/subselect_sj.result
        those plans accidentally had join buffering enabled for the non-first
        inner tables in a semijoin materialization nest
     @ mysql-test/r/subselect_sj2.result
        result for test
     @ mysql-test/r/subselect_sj2_jcl6.result
        before this fix, the result of SELECT would be 2 and 2 which is wrong
     @ mysql-test/r/subselect_sj2_jcl7.result
        result for test
     @ mysql-test/r/subselect_sj_jcl6.result
        those plans accidentally had join buffering enabled for the non-first
        inner tables in a semijoin materialization nest.
        The test where 1 changes to 2 is another symptom of BUG#50358.
     @ mysql-test/r/subselect_sj_jcl7.result
        those plans accidentally had join buffering enabled for the non-first
        inner tables in a semijoin materialization nest
     @ mysql-test/t/subselect_sj2.test
        test for BUG#51018
     @ sql/sql_join_cache.cc
        * JOIN_TAB::use_match_flag(), is_last_inner_table(), get_first_inner_table()
        coded in-line in JOIN_CACHE, as they are quite specific to JOIN_CACHE
        * cache value of check_only_first_match
     @ sql/sql_select.cc
        * "join->join_tab + i + pos->n_sj_tables - 1" was used in many places in
        setup_semijoin_dups_elimination(), computing it once now
        * All semijoin strategies now set JOIN_TAB::first_sj_inner_tab and
        JOIN_TAB::last_sj_inner_tab.
        In check_join_cache_usage(), we want to disable join buffering if the
        table is in semijoin materialization (see the TODO in the function's
        comment). The semijoin strategy is however stored only in the first
        semijoin inner table, other inner ones have SJ_OPT_NONE (see end of 
        fix_semijoin_strategies_for_picked_join_order()). So when 
        check_join_cache_usage() was looking at a non-first inner table,
        sj_is_materialize_strategy() said "no", in the end join buffering was
        not disabled for that non-first inner table, leading to wrong results.
        To find the strategy for the table, we need to access the first inner
        table: we can now do so with tab->first_sj_inner_tab (now filled),
        through get_sj_strategy().
        All existing code which implicitely applied only to firstmatch inner
        tables, still does so, because a test for
        get_sj_strategy()==SJ_OPT_FIRST_MATCH is added
     @ sql/sql_select.h
        * JOIN_TAB::first_sj_inner_tab and JOIN_TAB::last_sj_inner_tab were set
        only for firstmatch. As the same information is useful for
        check_join_cache_usage() to detect semijoin materialization, we now set
        it for all semijoin strategies. A member function JOIN_TAB::get_sj_strategy()
        gives the table's semijoin strategy. Thus, existing code which used
        first_sj_inner_tab (implicitely testing for firstmatch) should now additionally
        test get_sj_strategy()==SJ_OPT_FIRST_MATCH, to not change behaviour.
        * is_inner_table_of_semi_join_with_first_match() is removed as it's one-line,
        not very general and replacable by get_sj_strategy()==SJ_OPT_FIRST_MATCH.
        * is_single_inner_of_semi_join_with_first_match() is replaced by
        is_single_inner_of_semi_join() (more general).
        * certain member functions used only by JOIN_CACHE, and quite specific of it
        (use_match_flag(),check_only_first_match()) are either removed and inserted
        in-line in JOIN_CACHE's code, or moved to being JOIN_CACHE member functions:
        that's the case for check_only_first_match().
        Same for is_last_inner_table() and get_first_inner_table(), which had
        misleading names (they apply only to semijoin inner tables served by
        FirstMatch, not all semijoin inner tables); this behaviour being caused
        by JOIN_CACHE, it's better if those specifics are inside JOIN_CACHE code
        and not in JOIN_TAB (putting them in JOIN_TAB suggested that they
        were generic-purpose, reusable functions).
        * Additionally, we add JOIN_CACHE::check_only_first_match, a cached value
        to avoid computing its value for each record (see sql_join_cache.cc)

    modified:
      mysql-test/r/subselect3.result
      mysql-test/r/subselect3_jcl6.result
      mysql-test/r/subselect4.result
      mysql-test/r/subselect_sj.result
      mysql-test/r/subselect_sj2.result
      mysql-test/r/subselect_sj2_jcl6.result
      mysql-test/r/subselect_sj2_jcl7.result
      mysql-test/r/subselect_sj_jcl6.result
      mysql-test/r/subselect_sj_jcl7.result
      mysql-test/t/subselect_sj2.test
      sql/sql_join_cache.cc
      sql/sql_select.cc
      sql/sql_select.h
=== modified file 'mysql-test/r/subselect3.result'
--- a/mysql-test/r/subselect3.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect3.result	2010-06-11 12:27:38 +0000
@@ -1059,7 +1059,7 @@ explain select t21.* from t21,t22 where 
 t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t11	ALL	NULL	NULL	NULL	NULL	8	Using where; Using temporary; Using filesort; Start materialize; Scan
-1	PRIMARY	t12	ALL	NULL	NULL	NULL	NULL	8	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t12	ALL	NULL	NULL	NULL	NULL	8	Using where; End materialize
 1	PRIMARY	t22	ALL	NULL	NULL	NULL	NULL	26	Using where; Using join buffer (BNL, regular buffers)
 1	PRIMARY	t21	ALL	NULL	NULL	NULL	NULL	26	Using where; Using join buffer (BNL, regular buffers)
 select t21.* from t21,t22 where t21.a = t22.a and 
@@ -1416,8 +1416,8 @@ explain select * from t1 where (a,b,c) i
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	PRIMARY	X	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	Y	ALL	NULL	NULL	NULL	NULL	6	Using join buffer (BNL, regular buffers)
-1	PRIMARY	Z	ALL	NULL	NULL	NULL	NULL	6	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	Y	ALL	NULL	NULL	NULL	NULL	6	
+1	PRIMARY	Z	ALL	NULL	NULL	NULL	NULL	6	End materialize
 drop table t0,t1,t2;
 
 BUG#40118 Crash when running Batched Key Access and requiring one match for each key

=== modified file 'mysql-test/r/subselect3_jcl6.result'
--- a/mysql-test/r/subselect3_jcl6.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect3_jcl6.result	2010-06-11 12:27:38 +0000
@@ -1063,14 +1063,13 @@ explain select t21.* from t21,t22 where 
 t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t11	ALL	NULL	NULL	NULL	NULL	8	Using where; Using temporary; Using filesort; Start materialize; Scan
-1	PRIMARY	t12	ALL	NULL	NULL	NULL	NULL	8	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t12	ALL	NULL	NULL	NULL	NULL	8	Using where; End materialize
 1	PRIMARY	t22	ALL	NULL	NULL	NULL	NULL	26	Using where; Using join buffer (BNL, incremental buffers)
 1	PRIMARY	t21	ALL	NULL	NULL	NULL	NULL	26	Using where; Using join buffer (BNL, incremental buffers)
 select t21.* from t21,t22 where t21.a = t22.a and 
 t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
 a	b	c
 256	67	NULL
-256	67	NULL
 drop table t1, t11, t12, t21, t22;
 create table t1(a int);
 insert into t1 values (0),(1);
@@ -1421,8 +1420,8 @@ explain select * from t1 where (a,b,c) i
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	PRIMARY	X	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	Y	ALL	NULL	NULL	NULL	NULL	6	Using join buffer (BNL, incremental buffers)
-1	PRIMARY	Z	ALL	NULL	NULL	NULL	NULL	6	End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	Y	ALL	NULL	NULL	NULL	NULL	6	
+1	PRIMARY	Z	ALL	NULL	NULL	NULL	NULL	6	End materialize
 drop table t0,t1,t2;
 
 BUG#40118 Crash when running Batched Key Access and requiring one match for each key
@@ -1478,7 +1477,7 @@ WHERE cona.postalStripped='T2H3B2'
 	);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	cona	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where; Start materialize; Scan
-1	PRIMARY	c	eq_ref	PRIMARY	PRIMARY	4	test.cona.idContact	1	100.00	End materialize; Using join buffer (BKA, incremental buffers)
+1	PRIMARY	c	eq_ref	PRIMARY	PRIMARY	4	test.cona.idContact	1	100.00	End materialize
 1	PRIMARY	a	index	PRIMARY	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (BNL, incremental buffers)
 Warnings:
 Note	1003	select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2'))

=== modified file 'mysql-test/r/subselect4.result'
--- a/mysql-test/r/subselect4.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect4.result	2010-06-11 12:27:38 +0000
@@ -261,7 +261,7 @@ WHERE PTYPE = 'Design'));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	t1_IDX	NULL	NULL	NULL	5	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 PREPARE stmt FROM "EXPLAIN SELECT EMPNAME
 FROM t1
 WHERE EMPNUM IN
@@ -275,12 +275,12 @@ EXECUTE stmt;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	t1_IDX	NULL	NULL	NULL	5	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 EXECUTE stmt;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	t1_IDX	NULL	NULL	NULL	5	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 DEALLOCATE PREPARE stmt;
 DROP INDEX t1_IDX ON t1;
 CREATE INDEX t1_IDX ON t1(EMPNUM);
@@ -296,7 +296,7 @@ WHERE PTYPE = 'Design'));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	t1_IDX	NULL	NULL	NULL	5	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 PREPARE stmt FROM "EXPLAIN SELECT EMPNAME
 FROM t1
 WHERE EMPNUM IN
@@ -310,12 +310,12 @@ EXECUTE stmt;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	t1_IDX	NULL	NULL	NULL	5	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 EXECUTE stmt;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	t1_IDX	NULL	NULL	NULL	5	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 DEALLOCATE PREPARE stmt;
 DROP INDEX t1_IDX ON t1;
 EXPLAIN SELECT EMPNAME
@@ -330,7 +330,7 @@ WHERE PTYPE = 'Design'));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	5	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 PREPARE stmt FROM "EXPLAIN SELECT EMPNAME
 FROM t1
 WHERE EMPNUM IN
@@ -344,12 +344,12 @@ EXECUTE stmt;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	5	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 EXECUTE stmt;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Start materialize
-1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	12	Using where; End materialize
 DEALLOCATE PREPARE stmt;
 SET SESSION optimizer_switch = @old_optimizer_switch;
 SET SESSION optimizer_join_cache_level = @old_optimizer_join_cache_level;
@@ -415,7 +415,7 @@ FROM t3));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	100.00	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	100.00	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	100.00	End materialize
 Warnings:
 Note	1003	select `test`.`t1`.`id` AS `id` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2`) where 1
 delete from t2;
@@ -453,8 +453,8 @@ FROM t4)));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	9	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	9	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	9	Using join buffer (BNL, regular buffers)
-1	PRIMARY	t4	ALL	NULL	NULL	NULL	NULL	9	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	9	
+1	PRIMARY	t4	ALL	NULL	NULL	NULL	NULL	9	End materialize
 SELECT *
 FROM t1
 WHERE 1 IN(SELECT 1

=== modified file 'mysql-test/r/subselect_sj.result'
--- a/mysql-test/r/subselect_sj.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect_sj.result	2010-06-11 12:27:38 +0000
@@ -1131,7 +1131,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	system	NULL	NULL	NULL	NULL	1	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1161,7 +1161,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	system	NULL	NULL	NULL	NULL	1	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1722,7 +1722,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1752,7 +1752,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1787,7 +1787,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1860,7 +1860,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1898,7 +1898,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i

=== modified file 'mysql-test/r/subselect_sj2.result'
--- a/mysql-test/r/subselect_sj2.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect_sj2.result	2010-06-11 12:27:38 +0000
@@ -714,3 +714,26 @@ DROP PROCEDURE p1;
 DROP PROCEDURE p2;
 DROP PROCEDURE p3;
 DROP PROCEDURE p4;
+#
+# Bug#53058 - semijoin execution of subquery with outerjoin yields wrong result
+#
+CREATE TABLE t1 (i INTEGER);
+CREATE TABLE t2 (i INTEGER);
+CREATE TABLE t3 (i INTEGER);
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (6);
+INSERT INTO t3 VALUES (1), (2);
+explain extended SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	100.00	Start materialize; Scan
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	100.00	Using where; End materialize
+1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where; Using join buffer (BNL, regular buffers)
+Warnings:
+Note	1003	select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t3` left join `test`.`t2` on((`test`.`t2`.`i` = `test`.`t3`.`i`))) where (`test`.`t1`.`i` = `test`.`t3`.`i`)
+SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+i
+1
+2
+drop table t1,t2,t3;

=== modified file 'mysql-test/r/subselect_sj2_jcl6.result'
--- a/mysql-test/r/subselect_sj2_jcl6.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect_sj2_jcl6.result	2010-06-11 12:27:38 +0000
@@ -717,6 +717,29 @@ DROP PROCEDURE p1;
 DROP PROCEDURE p2;
 DROP PROCEDURE p3;
 DROP PROCEDURE p4;
+#
+# Bug#53058 - semijoin execution of subquery with outerjoin yields wrong result
+#
+CREATE TABLE t1 (i INTEGER);
+CREATE TABLE t2 (i INTEGER);
+CREATE TABLE t3 (i INTEGER);
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (6);
+INSERT INTO t3 VALUES (1), (2);
+explain extended SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	100.00	Start materialize; Scan
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	100.00	Using where; End materialize
+1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where; Using join buffer (BNL, incremental buffers)
+Warnings:
+Note	1003	select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t3` left join `test`.`t2` on((`test`.`t2`.`i` = `test`.`t3`.`i`))) where (`test`.`t1`.`i` = `test`.`t3`.`i`)
+SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+i
+1
+2
+drop table t1,t2,t3;
 set optimizer_join_cache_level=default;
 show variables like 'optimizer_join_cache_level';
 Variable_name	Value

=== modified file 'mysql-test/r/subselect_sj2_jcl7.result'
--- a/mysql-test/r/subselect_sj2_jcl7.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect_sj2_jcl7.result	2010-06-11 12:27:38 +0000
@@ -717,6 +717,29 @@ DROP PROCEDURE p1;
 DROP PROCEDURE p2;
 DROP PROCEDURE p3;
 DROP PROCEDURE p4;
+#
+# Bug#53058 - semijoin execution of subquery with outerjoin yields wrong result
+#
+CREATE TABLE t1 (i INTEGER);
+CREATE TABLE t2 (i INTEGER);
+CREATE TABLE t3 (i INTEGER);
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (6);
+INSERT INTO t3 VALUES (1), (2);
+explain extended SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	100.00	Start materialize; Scan
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	100.00	Using where; End materialize
+1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where; Using join buffer (BNL, regular buffers)
+Warnings:
+Note	1003	select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t3` left join `test`.`t2` on((`test`.`t2`.`i` = `test`.`t3`.`i`))) where (`test`.`t1`.`i` = `test`.`t3`.`i`)
+SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+i
+1
+2
+drop table t1,t2,t3;
 set optimizer_join_cache_level=default;
 show variables like 'optimizer_join_cache_level';
 Variable_name	Value

=== modified file 'mysql-test/r/subselect_sj_jcl6.result'
--- a/mysql-test/r/subselect_sj_jcl6.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect_sj_jcl6.result	2010-06-11 12:27:38 +0000
@@ -1135,7 +1135,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	system	NULL	NULL	NULL	NULL	1	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1165,7 +1165,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	system	NULL	NULL	NULL	NULL	1	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1642,12 +1642,12 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, incremental buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 i
-1
+2
 1
 EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1726,7 +1726,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, incremental buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1756,7 +1756,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using join buffer (BNL, incremental buffers)
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1771,7 +1771,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, incremental buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
@@ -1791,7 +1791,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, incremental buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1842,7 +1842,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
 i
@@ -1853,7 +1853,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 i
@@ -1864,7 +1864,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1875,7 +1875,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
 i
@@ -1893,7 +1893,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; Start materialize
-1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 i
@@ -1902,7 +1902,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, incremental buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i

=== modified file 'mysql-test/r/subselect_sj_jcl7.result'
--- a/mysql-test/r/subselect_sj_jcl7.result	2010-06-09 14:16:33 +0000
+++ b/mysql-test/r/subselect_sj_jcl7.result	2010-06-11 12:27:38 +0000
@@ -1135,7 +1135,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	system	NULL	NULL	NULL	NULL	1	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1165,7 +1165,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	system	NULL	NULL	NULL	NULL	1	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1642,7 +1642,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
@@ -1726,7 +1726,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1756,7 +1756,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1771,7 +1771,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	Using where; End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
@@ -1791,7 +1791,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize; Scan
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	1	End materialize
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (BNL, regular buffers)
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
@@ -1842,7 +1842,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
 i
@@ -1853,7 +1853,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 i
@@ -1864,7 +1864,7 @@ EXPLAIN SELECT * FROM t1 WHERE (t1.i) IN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	End materialize
 SELECT * FROM t1 WHERE (t1.i) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i
@@ -1875,7 +1875,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 LEFT JOIN t3 ON t2.i=t3.i);
 i
@@ -1893,7 +1893,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; Start materialize
-1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 RIGHT JOIN t3 ON t2.i=t3.i);
 i
@@ -1902,7 +1902,7 @@ EXPLAIN SELECT * FROM t1 WHERE (11) IN 
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
 1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	2	Start materialize
-1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize; Using join buffer (BNL, regular buffers)
+1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; End materialize
 SELECT * FROM t1 WHERE (11) IN 
 (SELECT t3.i FROM t2 STRAIGHT_JOIN t3);
 i

=== modified file 'mysql-test/t/subselect_sj2.test'
--- a/mysql-test/t/subselect_sj2.test	2010-06-09 13:46:16 +0000
+++ b/mysql-test/t/subselect_sj2.test	2010-06-11 12:27:38 +0000
@@ -900,3 +900,18 @@ DROP PROCEDURE p1;
 DROP PROCEDURE p2;
 DROP PROCEDURE p3;
 DROP PROCEDURE p4;
+
+--echo #
+--echo # Bug#53058 - semijoin execution of subquery with outerjoin yields wrong result
+--echo #
+CREATE TABLE t1 (i INTEGER);
+CREATE TABLE t2 (i INTEGER);
+CREATE TABLE t3 (i INTEGER);
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (6);
+INSERT INTO t3 VALUES (1), (2);
+explain extended SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+SELECT * FROM t1 WHERE (t1.i) IN 
+(SELECT t3.i FROM t3 LEFT JOIN t2 ON t2.i=t3.i);
+drop table t1,t2,t3;

=== modified file 'sql/sql_join_cache.cc'
--- a/sql/sql_join_cache.cc	2010-06-09 13:46:16 +0000
+++ b/sql/sql_join_cache.cc	2010-06-11 12:27:38 +0000
@@ -140,7 +140,7 @@ uint add_table_data_fields_to_join_cache
     
 
 /* 
-  Determine different counters of fields associated with a record in the cache  
+  Determine various counters of fields associated with a record in the cache
 
   SYNOPSIS
     calc_record_fields()
@@ -150,7 +150,8 @@ uint add_table_data_fields_to_join_cache
     of the cache and saves this number in the 'fields' member. It also
     determines the number of flag fields and the number of blobs.
     The function sets 'with_match_flag' on if 'join_tab' needs a match flag
-    i.e. if it is the first inner table of an outer join or a semi-join.  
+    i.e. if it is the first inner table of an outer join, or of a semi-join
+    with FirstMatch strategy.
 
   RETURN
     none 
@@ -179,7 +180,9 @@ void JOIN_CACHE::calc_record_fields()
 
     fields+= tab->check_rowid_field();
   }
-  if ((with_match_flag= join_tab->use_match_flag()))
+  if ((with_match_flag= (join_tab->is_first_inner_for_outer_join() ||
+                         (join_tab->first_sj_inner_tab == join_tab &&
+                          join_tab->get_sj_strategy() == SJ_OPT_FIRST_MATCH))))
     flag_fields++;
   fields+= flag_fields;
 }
@@ -432,6 +435,8 @@ void JOIN_CACHE::set_constants()
                (prev_cache ? prev_cache->get_size_of_rec_offset() : 0) + 
                length;
   pack_length_with_blob_ptrs= pack_length + blobs*sizeof(uchar *);
+
+  check_only_first_match= calc_check_only_first_match(join_tab);
 }
 
 
@@ -1754,7 +1759,6 @@ enum_nested_loop_state JOIN_CACHE_BNL::j
   JOIN_TAB *tab;
   READ_RECORD *info;
   enum_nested_loop_state rc= NESTED_LOOP_OK;
-  bool check_only_first_match= join_tab->check_only_first_match();
   SQL_SELECT *select= join_tab->cache_select;
 
   join_tab->table->null_row= 0;
@@ -1987,19 +1991,26 @@ inline bool JOIN_CACHE::check_match(ucha
   if (join_tab->select && join_tab->select->skip_record())
     return FALSE;
 
-  if (!join_tab->is_last_inner_table())
-    return TRUE;
+  if (!((join_tab->first_inner &&
+         join_tab->first_inner->last_inner == join_tab) ||
+        (join_tab->last_sj_inner_tab == join_tab &&
+         join_tab->get_sj_strategy() == SJ_OPT_FIRST_MATCH)))
+    return TRUE; // not the last inner table
 
   /* 
      This is the last inner table of an outer join,
      and maybe of other embedding outer joins, or
      this is the last inner table of a semi-join.
   */
-  JOIN_TAB *first_inner= join_tab->get_first_inner_table();
+  JOIN_TAB *first_inner= join_tab->first_inner ?
+    join_tab->first_inner :
+    ((join_tab->get_sj_strategy() == SJ_OPT_FIRST_MATCH) ?
+     join_tab->first_sj_inner_tab : NULL);
+
   do
   {
     set_match_flag_if_none(first_inner, rec_ptr);
-    if (first_inner->check_only_first_match() &&
+    if (calc_check_only_first_match(first_inner) &&
         !join_tab->first_inner)
       return TRUE;
     /* 
@@ -2282,7 +2293,6 @@ enum_nested_loop_state JOIN_CACHE_BKA::j
   handler *file= join_tab->table->file;
   enum_nested_loop_state rc= NESTED_LOOP_OK;
   uchar *rec_ptr= 0;
-  bool check_only_first_match= join_tab->check_only_first_match();
 
   /* Set functions to iterate over keys in the join buffer */
 
@@ -3168,7 +3178,6 @@ JOIN_CACHE_BKA_UNIQUE::join_matching_rec
   uchar *key_chain_ptr;
   handler *file= join_tab->table->file;
   enum_nested_loop_state rc= NESTED_LOOP_OK;
-  bool check_only_first_match= join_tab->check_only_first_match();
   bool no_association= test(mrr_mode &  HA_MRR_NO_ASSOCIATION);
 
   /* Set functions to iterate over keys in the join buffer */

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-06-09 14:16:33 +0000
+++ b/sql/sql_select.cc	2010-06-11 12:27:38 +0000
@@ -1284,6 +1284,12 @@ int setup_semijoin_dups_elimination(JOIN
     JOIN_TAB *tab=join->join_tab + i;
     POSITION *pos= join->best_positions + i;
     uint keylen, keyno;
+    if (pos->sj_strategy == SJ_OPT_NONE)
+    {
+      i++;  // nothing to do
+      continue;
+    }
+    JOIN_TAB *tab_end= tab + pos->n_sj_tables - 1;
     switch (pos->sj_strategy) {
       case SJ_OPT_MATERIALIZE_LOOKUP:
       case SJ_OPT_MATERIALIZE_SCAN:
@@ -1294,7 +1300,7 @@ int setup_semijoin_dups_elimination(JOIN
       {
         DBUG_ASSERT(tab->emb_sj_nest != NULL); // First table must be inner
         /* We jump from the last table to the first one */
-        tab->loosescan_match_tab= tab + pos->n_sj_tables - 1;
+        tab->loosescan_match_tab= tab_end;
 
         /* For LooseScan, duplicate elimination is based on rows being sorted 
            on key. We need to make sure that range select keep the sorted index
@@ -1316,7 +1322,7 @@ int setup_semijoin_dups_elimination(JOIN
 
         tab->loosescan_key_len= keylen;
         if (pos->n_sj_tables > 1) 
-          tab[pos->n_sj_tables - 1].do_firstmatch= tab;
+          tab_end->do_firstmatch= tab;
         i+= pos->n_sj_tables;
         break;
       }
@@ -1346,8 +1352,7 @@ int setup_semijoin_dups_elimination(JOIN
            - tables that need their rowids to be put into temptable
            - the last outer table
         */
-        for (JOIN_TAB *j=join->join_tab + first_table; 
-             j < join->join_tab + i + pos->n_sj_tables; j++)
+        for (JOIN_TAB *j=join->join_tab + first_table; j <= tab_end; j++)
         {
           if (sj_table_is_included(join, j))
           {
@@ -1399,33 +1404,34 @@ int setup_semijoin_dups_elimination(JOIN
           sjtbl->have_confluent_row= FALSE;
         }
         join->join_tab[first_table].flush_weedout_table= sjtbl;
-        join->join_tab[i + pos->n_sj_tables - 1].check_weed_out_table= sjtbl;
+        tab_end->check_weed_out_table= sjtbl;
 
         i+= pos->n_sj_tables;
         break;
       }
       case SJ_OPT_FIRST_MATCH:
       {
-        JOIN_TAB *j, *jump_to= tab-1;
+        JOIN_TAB *jump_to= tab - 1;
         DBUG_ASSERT(tab->emb_sj_nest != NULL); // First table must be inner
-        for (j= tab; j != tab + pos->n_sj_tables; j++)
-        {
-          if (!tab->emb_sj_nest) /// @todo fix this (BUG#51457)
-            jump_to= tab;
-          else
-          {
-            /* inner table, remember the interval of them */
-            j->first_sj_inner_tab= tab;
-            j->last_sj_inner_tab= tab + pos->n_sj_tables - 1;
-          }
-        }
-        j[-1].do_firstmatch= jump_to;
+        if (!tab->emb_sj_nest)
+          jump_to= tab;         /// @todo fix this (BUG#51457)
+        tab_end->do_firstmatch= jump_to;
         i+= pos->n_sj_tables;
         break;
       }
-      case SJ_OPT_NONE:
-        i++;
-        break;
+    }
+    /*
+      Remember the first and last semijoin inner tables; this serves to tell
+      a JOIN_TAB's semijoin strategy (like in check_join_cache_usage()).
+    */
+    JOIN_TAB *last_sj_inner=
+      (pos->sj_strategy == SJ_OPT_DUPS_WEEDOUT) ?
+      /* Range may end with non-inner table so cannot set last_sj_inner_tab */
+      NULL : tab_end;
+    for (JOIN_TAB *j= tab; j <= tab_end; j++)
+    {
+      j->first_sj_inner_tab= tab;
+      j->last_sj_inner_tab=  last_sj_inner;
     }
   }
   DBUG_RETURN(FALSE);
@@ -5754,7 +5760,14 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
       /* Mark that we can optimize LEFT JOIN */
       if (field->val->type() == Item::NULL_ITEM &&
 	  !field->field->real_maybe_null())
-	field->field->table->reginfo.not_exists_optimize=1;
+      {
+        /*
+          Example:
+          SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.a IS NULL;
+          this just wants rows of t1 where t1.a does not exist in t2.
+        */
+        field->field->table->reginfo.not_exists_optimize=1;
+      }
     }
   }
   for (i=0 ; i < tables ; i++)
@@ -9937,7 +9950,7 @@ void revise_cache_usage(JOIN_TAB *join_t
       end_tab= first_inner;
     }
   }
-  else if (join_tab->first_sj_inner_tab)
+  else if (join_tab->get_sj_strategy() == SJ_OPT_FIRST_MATCH)
   {
     first_inner= join_tab->first_sj_inner_tab;
     for (tab= join_tab-1; tab >= first_inner; tab--)
@@ -10056,6 +10069,7 @@ uint check_join_cache_usage(JOIN_TAB *ta
   uint force_unlinked_cache= (cache_level & 1) ?
     JOIN_CACHE::NON_INCREMENTAL_BUFFER : 0;
   uint i= tab-join->join_tab;
+  const uint tab_sj_strategy= tab->get_sj_strategy();
   *icp_other_tables_ok= TRUE;
   
   if (cache_level == 0 || i == join->const_tables)
@@ -10074,8 +10088,8 @@ uint check_join_cache_usage(JOIN_TAB *ta
     Use join cache with FirstMatch semi-join strategy only when semi-join
     contains only one table.
   */
-  if (tab->is_inner_table_of_semi_join_with_first_match() &&
-      !tab->is_single_inner_of_semi_join_with_first_match())
+  if (tab_sj_strategy == SJ_OPT_FIRST_MATCH &&
+      !tab->is_single_inner_of_semi_join())
     goto no_join_cache;
   /*
     Non-linked join buffers can't guarantee one match
@@ -10085,12 +10099,12 @@ uint check_join_cache_usage(JOIN_TAB *ta
       !tab->is_single_inner_of_outer_join())
     goto no_join_cache;
 
-  /*
-    Don't use join buffering if we're dictated not to by no_jbuf_after (this
-    ...)
-  */
-  if (!(i <= no_jbuf_after) || tab->loosescan_match_tab || 
-      sj_is_materialize_strategy(join->best_positions[i].sj_strategy))
+  /* No join buffering if prevented by no_jbuf_after */
+  if (!(i <= no_jbuf_after) || tab->loosescan_match_tab)
+    goto no_join_cache;
+
+  /* Neither if semijoin Materialization */
+  if (sj_is_materialize_strategy(tab_sj_strategy))
     goto no_join_cache;
 
   for (JOIN_TAB *first_inner= tab->first_inner; first_inner;
@@ -10099,7 +10113,8 @@ uint check_join_cache_usage(JOIN_TAB *ta
     if (first_inner != tab && !first_inner->use_join_cache)
       goto no_join_cache;
   }
-  if (tab->first_sj_inner_tab && tab->first_sj_inner_tab != tab &&
+  if (tab_sj_strategy == SJ_OPT_FIRST_MATCH &&
+      tab->first_sj_inner_tab != tab &&
       !tab->first_sj_inner_tab->use_join_cache)
     goto no_join_cache;
   if (!tab[-1].use_join_cache)
@@ -10118,7 +10133,7 @@ uint check_join_cache_usage(JOIN_TAB *ta
           goto no_join_cache;
       }
     }
-    else if (tab->first_sj_inner_tab &&
+    else if (tab_sj_strategy == SJ_OPT_FIRST_MATCH &&
              tab->first_sj_inner_tab == tab[-1].first_sj_inner_tab)
       goto no_join_cache; 
   }       
@@ -10128,7 +10143,8 @@ uint check_join_cache_usage(JOIN_TAB *ta
 
   switch (tab->type) {
   case JT_ALL:
-    if (cache_level <= 2 && (tab->first_inner || tab->first_sj_inner_tab))
+    if (cache_level <= 2 &&
+        (tab->first_inner || tab_sj_strategy == SJ_OPT_FIRST_MATCH))
       goto no_join_cache;
     if ((options & SELECT_DESCRIBE) ||
         ((tab->cache= new JOIN_CACHE_BNL(join, tab, prev_cache))) &&
@@ -10816,6 +10832,21 @@ void JOIN_TAB::cleanup()
 
 
 /**
+  @returns semijoin strategy for this table.
+*/
+inline uint JOIN_TAB::get_sj_strategy() const
+{
+  if (first_sj_inner_tab == NULL)
+    return SJ_OPT_NONE;
+  const int j= first_sj_inner_tab - join->join_tab;
+  DBUG_ASSERT(j >= 0);
+  uint s= join->best_positions[j].sj_strategy;
+  DBUG_ASSERT(s != SJ_OPT_NONE);
+  return s;
+}
+
+
+/**
   Partially cleanup JOIN after it has executed: close index or rnd read
   (table cursors), free quick selects.
 

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2010-06-09 14:16:33 +0000
+++ b/sql/sql_select.h	2010-06-11 12:27:38 +0000
@@ -167,6 +167,17 @@ typedef enum_nested_loop_state
 Next_select_func setup_end_select_func(JOIN *join);
 int rr_sequential(READ_RECORD *info);
 
+#define SJ_OPT_NONE 0
+#define SJ_OPT_DUPS_WEEDOUT 1
+#define SJ_OPT_LOOSE_SCAN   2
+#define SJ_OPT_FIRST_MATCH  3
+#define SJ_OPT_MATERIALIZE_LOOKUP  4
+#define SJ_OPT_MATERIALIZE_SCAN  5
+
+inline bool sj_is_materialize_strategy(uint strategy)
+{
+  return strategy >= SJ_OPT_MATERIALIZE_LOOKUP;
+}
 
 typedef struct st_join_table
 {
@@ -266,7 +277,12 @@ typedef struct st_join_table
   */
   TABLE_LIST    *emb_sj_nest;
 
-  /* FirstMatch variables (final QEP) */
+  /**
+    Boundaries of semijoin inner tables around this table. Valid only once
+    final QEP has been chosen. Depending on the strategy, they may define an
+    interval (all tables inside are inner of a semijoin) or
+    not. last_sj_inner_tab is not set for Duplicates Weedout.
+  */
   struct st_join_table *first_sj_inner_tab;
   struct st_join_table *last_sj_inner_tab;
 
@@ -331,17 +347,13 @@ typedef struct st_join_table
     }
     return test(used_rowid_fields);
   }
-  bool is_inner_table_of_semi_join_with_first_match()
-  {
-    return first_sj_inner_tab != NULL;
-  }
   bool is_inner_table_of_outer_join()
   {
     return first_inner != NULL;
   }
-  bool is_single_inner_of_semi_join_with_first_match()
+  bool is_single_inner_of_semi_join()
   {
-    return first_sj_inner_tab == this && last_sj_inner_tab == this;            
+    return first_sj_inner_tab == this && last_sj_inner_tab == this;
   }
   bool is_single_inner_of_outer_join()
   {
@@ -351,27 +363,6 @@ typedef struct st_join_table
   {
     return first_inner && first_inner == this;
   }
-  bool use_match_flag()
-  {
-    return is_first_inner_for_outer_join() || first_sj_inner_tab == this ; 
-  }
-  bool check_only_first_match()
-  {
-    return  last_sj_inner_tab == this ||
-           (first_inner && first_inner->last_inner == this &&
-            table->reginfo.not_exists_optimize);
-  }
-  bool is_last_inner_table()
-  {
-    return (first_inner && first_inner->last_inner == this) ||
-           last_sj_inner_tab == this;
-  }
-  struct st_join_table *get_first_inner_table()
-  {
-    if (first_inner)
-      return first_inner;
-    return first_sj_inner_tab; 
-  }
   void set_select_cond(COND *to, uint line)
   {
     DBUG_PRINT("info", ("select_cond changes %p -> %p at line %u tab %p",
@@ -386,6 +377,7 @@ typedef struct st_join_table
       select->cond= new_cond;
     return tmp_select_cond;
   }
+  uint get_sj_strategy() const;
 } JOIN_TAB;
 
 /* 
@@ -631,6 +623,9 @@ protected:
     to records in the buffer.   */
   uchar *curr_rec_link;
 
+  /** Cached value of calc_check_only_first_match(join_tab) */
+  bool check_only_first_match;
+
   void calc_record_fields();     
   int alloc_fields(uint external_fields);
   void create_flag_fields();
@@ -726,6 +721,15 @@ protected:
   /* Check matching to a partial join record from the join buffer */
   bool check_match(uchar *rec_ptr);
 
+  /** @returns whether we should check only the first match for this table */
+  bool calc_check_only_first_match(const JOIN_TAB *t) const
+  {
+    return (t->last_sj_inner_tab == t &&
+            t->get_sj_strategy() == SJ_OPT_FIRST_MATCH) ||
+      (t->first_inner && t->first_inner->last_inner == t &&
+       t->table->reginfo.not_exists_optimize);
+  }
+
 public:
 
   /* Table to be joined with the partial join records from the cache */ 
@@ -1466,17 +1470,6 @@ public:
   SJ_TMP_TABLE *next; 
 };
 
-#define SJ_OPT_NONE 0
-#define SJ_OPT_DUPS_WEEDOUT 1
-#define SJ_OPT_LOOSE_SCAN   2
-#define SJ_OPT_FIRST_MATCH  3
-#define SJ_OPT_MATERIALIZE_LOOKUP  4
-#define SJ_OPT_MATERIALIZE_SCAN  5
-
-inline bool sj_is_materialize_strategy(uint strategy)
-{
-  return strategy >= SJ_OPT_MATERIALIZE_LOOKUP;
-}
 
 class JOIN :public Sql_alloc
 {


Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20100611122738-yht0b6wah5i738hy.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (guilhem:3192) Bug#50358Bug#51018Guilhem Bichot11 Jun