From: Jorgen Loland Date: January 5 2011 8:45am Subject: bzr commit into mysql-next-mr-bugfixing branch (jorgen.loland:3244) List-Archive: http://lists.mysql.com/commits/127953 Message-Id: <20110105084519.5F621374@atum21.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7398818342851039758==" --===============7398818342851039758== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///export/home/jl208045/mysql/wl4800/mysql-next-mr-opt-backporting-wl4800-range-subselect/ based on revid:jorgen.loland@stripped 3244 Jorgen Loland 2011-01-05 WL4800: propagate_cond_constants() does not evaluate conditions, so no optimizer trace wrapping is needed for potential subselect optimizations inside this function. @ sql/sql_select.cc propagate_cond_constants() does not evaluate conditions, so no optimizer trace wrapping is needed for potential subselect optimizations inside this function. modified: mysql-test/r/optimizer_trace_no_prot.result mysql-test/r/optimizer_trace_ps_prot.result mysql-test/r/optimizer_trace_range.result mysql-test/r/optimizer_trace_subquery.result sql/sql_select.cc === modified file 'mysql-test/r/optimizer_trace_no_prot.result' --- a/mysql-test/r/optimizer_trace_no_prot.result 2010-12-13 14:03:16 +0000 +++ b/mysql-test/r/optimizer_trace_no_prot.result 2011-01-05 08:45:13 +0000 @@ -844,8 +844,6 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(5,(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 2))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(5,(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 2))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -1038,7 +1036,7 @@ select (@query:=QUERY)+NULL, (@trace:=TR NULL NULL select length(@trace); length(@trace) -11083 +10981 set optimizer_trace_max_mem_size=9000; select length(@query)+length(@trace) > @@optimizer_trace_max_mem_size; length(@query)+length(@trace) > @@optimizer_trace_max_mem_size @@ -1047,7 +1045,7 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR c select (@missing_bytes:=missing_bytes_beyond_max_mem_size) from information_schema.OPTIMIZER_TRACE; (@missing_bytes:=missing_bytes_beyond_max_mem_size) -2209 +2095 select (@query2:=QUERY)+NULL,(@trace2:=TRACE)+NULL from information_schema.OPTIMIZER_TRACE; (@query2:=QUERY)+NULL (@trace2:=TRACE)+NULL NULL NULL @@ -1055,7 +1053,7 @@ select length(@trace2), (length(@trace2) + @missing_bytes) = length(@trace), @query2 = @query; length(@trace2) (length(@trace2) + @missing_bytes) = length(@trace) @query2 = @query -8874 1 1 +8886 1 1 select length(@query2) + length(@trace2) between (@@optimizer_trace_max_mem_size-100) and (@@optimizer_trace_max_mem_size+100); length(@query2) + length(@trace2) @@ -1402,8 +1400,6 @@ explain SELECT c FROM t5 where c+1 in (s "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t5`.`c` + 1),(`test`.`t5`.`c` + 1) in (/* select#2 */ select (`test`.`t6`.`d` + 1) from `test`.`t6` where isnull(`test`.`t6`.`d`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t5`.`c` + 1),(`test`.`t5`.`c` + 1) in (/* select#2 */ select (`test`.`t6`.`d` + 1) from `test`.`t6` where isnull(`test`.`t6`.`d`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -1640,8 +1636,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select min(`test`.`t1`.`s2`) from `test`.`t1`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select min(`test`.`t1`.`s2`) from `test`.`t1`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -1834,8 +1828,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select max(`test`.`t1`.`s2`) from `test`.`t1`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select max(`test`.`t1`.`s2`) from `test`.`t1`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -2045,8 +2037,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(`test`.`t1`.`s1`,(/* select#2 */ select 1 from `test`.`t1` where ((`test`.`t1`.`s1`) = `test`.`t1`.`s2`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(`test`.`t1`.`s1`,(/* select#2 */ select 1 from `test`.`t1` where ((`test`.`t1`.`s1`) = `test`.`t1`.`s2`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -2268,8 +2258,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`s1`,`test`.`t1`.`s2`),(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where (((`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and ((`test`.`t1`.`s2`) = `test`.`t1`.`s1`))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`s1`,`test`.`t1`.`s2`),(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where (((`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and ((`test`.`t1`.`s2`) = `test`.`t1`.`s1`))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -2788,8 +2776,6 @@ where a1 in (select b1 from t2_16 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(`test`.`t1_16`.`a1`,(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(`test`.`t1_16`.`a1`,(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -3021,8 +3007,6 @@ WHERE c2 IN ( SELECT c2 FROM t2 WHERE c2 "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t2`.`c2`,(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and ((`test`.`t2`.`c2`) = `test`.`t2`.`c2`)))) and multiple equal(`test`.`t1`.`c1`, `test`.`t2`.`c2`))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t2`.`c2`,(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and ((`test`.`t2`.`c2`) = `test`.`t2`.`c2`)))) and multiple equal(`test`.`t1`.`c1`, `test`.`t2`.`c2`))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -3599,8 +3583,6 @@ concat(c1,'y') IN "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and (concat(`test`.`t1`.`c1`,'y'),concat(`test`.`t1`.`c1`,'y') in (/* select#3 */ select left(`test`.`t2`.`c2`,9) from `test`.`t2`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and (concat(`test`.`t1`.`c1`,'y'),concat(`test`.`t1`.`c1`,'y') in (/* select#3 */ select left(`test`.`t2`.`c2`,9) from `test`.`t2`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -4411,8 +4393,6 @@ select * from t1 where (t1.a,t1.b) not i "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(not(((`test`.`t1`.`a`,`test`.`t1`.`b`),(/* select#2 */ select `test`.`t2`.`c`,`test`.`t2`.`d` from `test`.`t2` where ((`test`.`t2`.`c` > 0) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, (`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, (`test`.`t2`.`d`), true))))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(not(((`test`.`t1`.`a`,`test`.`t1`.`b`),(/* select#2 */ select `test`.`t2`.`c`,`test`.`t2`.`d` from `test`.`t2` where ((`test`.`t2`.`c` > 0) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, (`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, (`test`.`t2`.`d`), true))))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, === modified file 'mysql-test/r/optimizer_trace_ps_prot.result' --- a/mysql-test/r/optimizer_trace_ps_prot.result 2010-12-13 14:03:16 +0000 +++ b/mysql-test/r/optimizer_trace_ps_prot.result 2011-01-05 08:45:13 +0000 @@ -828,8 +828,6 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(5,(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 2))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(5,(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and ((5) = 2))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -1022,7 +1020,7 @@ select (@query:=QUERY)+NULL, (@trace:=TR NULL NULL select length(@trace); length(@trace) -10628 +10526 set optimizer_trace_max_mem_size=9000; select length(@query)+length(@trace) > @@optimizer_trace_max_mem_size; length(@query)+length(@trace) > @@optimizer_trace_max_mem_size @@ -1031,7 +1029,7 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR c select (@missing_bytes:=missing_bytes_beyond_max_mem_size) from information_schema.OPTIMIZER_TRACE; (@missing_bytes:=missing_bytes_beyond_max_mem_size) -1756 +1638 select (@query2:=QUERY)+NULL,(@trace2:=TRACE)+NULL from information_schema.OPTIMIZER_TRACE; (@query2:=QUERY)+NULL (@trace2:=TRACE)+NULL NULL NULL @@ -1039,7 +1037,7 @@ select length(@trace2), (length(@trace2) + @missing_bytes) = length(@trace), @query2 = @query; length(@trace2) (length(@trace2) + @missing_bytes) = length(@trace) @query2 = @query -8872 1 1 +8888 1 1 select length(@query2) + length(@trace2) between (@@optimizer_trace_max_mem_size-100) and (@@optimizer_trace_max_mem_size+100); length(@query2) + length(@trace2) @@ -1386,8 +1384,6 @@ explain SELECT c FROM t5 where c+1 in (s "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t5`.`c` + 1),(`test`.`t5`.`c` + 1) in (/* select#2 */ select (`test`.`t6`.`d` + 1) from `test`.`t6` where isnull(`test`.`t6`.`d`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t5`.`c` + 1),(`test`.`t5`.`c` + 1) in (/* select#2 */ select (`test`.`t6`.`d` + 1) from `test`.`t6` where isnull(`test`.`t6`.`d`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -1624,8 +1620,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select min(`test`.`t1`.`s2`) from `test`.`t1`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select min(`test`.`t1`.`s2`) from `test`.`t1`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -1818,8 +1812,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select max(`test`.`t1`.`s2`) from `test`.`t1`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`s1` > (/* select#2 */ select max(`test`.`t1`.`s2`) from `test`.`t1`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -2029,8 +2021,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(`test`.`t1`.`s1`,(/* select#2 */ select 1 from `test`.`t1` where ((`test`.`t1`.`s1`) = `test`.`t1`.`s2`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(`test`.`t1`.`s1`,(/* select#2 */ select 1 from `test`.`t1` where ((`test`.`t1`.`s1`) = `test`.`t1`.`s2`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -2252,8 +2242,6 @@ explain extended select * from t1 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`s1`,`test`.`t1`.`s2`),(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where (((`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and ((`test`.`t1`.`s2`) = `test`.`t1`.`s1`))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`s1`,`test`.`t1`.`s2`),(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where (((`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and ((`test`.`t1`.`s2`) = `test`.`t1`.`s1`))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -2772,8 +2760,6 @@ where a1 in (select b1 from t2_16 where "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(`test`.`t1_16`.`a1`,(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(`test`.`t1_16`.`a1`,(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and ((`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -3005,8 +2991,6 @@ WHERE c2 IN ( SELECT c2 FROM t2 WHERE c2 "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t2`.`c2`,(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and ((`test`.`t2`.`c2`) = `test`.`t2`.`c2`)))) and multiple equal(`test`.`t1`.`c1`, `test`.`t2`.`c2`))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t2`.`c2`,(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and ((`test`.`t2`.`c2`) = `test`.`t2`.`c2`)))) and multiple equal(`test`.`t1`.`c1`, `test`.`t2`.`c2`))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -3583,8 +3567,6 @@ concat(c1,'y') IN "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and (concat(`test`.`t1`.`c1`,'y'),concat(`test`.`t1`.`c1`,'y') in (/* select#3 */ select left(`test`.`t2`.`c2`,9) from `test`.`t2`)))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and (concat(`test`.`t1`.`c1`,'y'),concat(`test`.`t1`.`c1`,'y') in (/* select#3 */ select left(`test`.`t2`.`c2`,9) from `test`.`t2`)))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -4387,8 +4369,6 @@ select * from t1 where (t1.a,t1.b) not i "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(not(((`test`.`t1`.`a`,`test`.`t1`.`b`),(/* select#2 */ select `test`.`t2`.`c`,`test`.`t2`.`d` from `test`.`t2` where ((`test`.`t2`.`c` > 0) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, (`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, (`test`.`t2`.`d`), true))))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(not(((`test`.`t1`.`a`,`test`.`t1`.`b`),(/* select#2 */ select `test`.`t2`.`c`,`test`.`t2`.`d` from `test`.`t2` where ((`test`.`t2`.`c` > 0) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, (((`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, (`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, (`test`.`t2`.`d`), true))))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, === modified file 'mysql-test/r/optimizer_trace_range.result' --- a/mysql-test/r/optimizer_trace_range.result 2011-01-05 08:42:16 +0000 +++ b/mysql-test/r/optimizer_trace_range.result 2011-01-05 08:45:13 +0000 @@ -3543,8 +3543,6 @@ SELECT * from t1 where topic = all (SELE "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((`test`.`t1`.`topic`,(/* select#2 */ select `test`.`t1`.`topic` from `test`.`t1` group by `test`.`t1`.`topic` having ((`test`.`t1`.`topic`) <> (`test`.`t1`.`topic`)))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((`test`.`t1`.`topic`,(/* select#2 */ select `test`.`t1`.`topic` from `test`.`t1` group by `test`.`t1`.`topic` having ((`test`.`t1`.`topic`) <> (`test`.`t1`.`topic`)))))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, === modified file 'mysql-test/r/optimizer_trace_subquery.result' --- a/mysql-test/r/optimizer_trace_subquery.result 2011-01-05 08:42:16 +0000 +++ b/mysql-test/r/optimizer_trace_subquery.result 2011-01-05 08:45:13 +0000 @@ -393,8 +393,6 @@ t1.a= (SELECT a FROM t2 LIMIT 1) { } ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "((NULL <> (/* select#3 */ select `test`.`t2`.`a` from `test`.`t2` limit 1)) and multiple equal((/* select#2 */ select NULL from `test`.`t2` limit 1), `test`.`t1`.`a`))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "((NULL <> (/* select#3 */ select `test`.`t2`.`a` from `test`.`t2` limit 1)) and multiple equal((/* select#2 */ select NULL from `test`.`t2` limit 1), `test`.`t1`.`a`))", "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, @@ -457,8 +455,6 @@ WHERE NOT EXISTS "evaluate_subselect_cond_steps": [ ] /* evaluate_subselect_cond_steps */, "after_equality_propagation": "(not(exists(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`a` = 50) and (`test`.`t2`.`b` = 3)))))", - "evaluate_subselect_cond_steps": [ - ] /* evaluate_subselect_cond_steps */, "after_constant_propagation": "(not(exists(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`a` = 50) and (`test`.`t2`.`b` = 3)))))", "evaluate_subselect_cond_steps": [ { === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2010-12-13 14:03:16 +0000 +++ b/sql/sql_select.cc 2011-01-05 08:45:13 +0000 @@ -14595,13 +14595,8 @@ optimize_cond(JOIN *join, Item *conds, L trace_cond.add("after_equality_propagation", conds); } - { - Opt_trace_disable_I_S disable_trace_wrapper(trace, - !conds->with_subselect); - Opt_trace_array trace_subselect(trace, "evaluate_subselect_cond_steps"); - /* change field = field to field = const for each found field = const */ - propagate_cond_constants(thd, (I_List *) 0, conds, conds); - } + /* change field = field to field = const for each found field = const */ + propagate_cond_constants(thd, (I_List *) 0, conds, conds); /* Remove all instances of item == item Remove all and-levels where CONST item != CONST item --===============7398818342851039758== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/jorgen.loland@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: jorgen.loland@stripped\ # 2ld14u8dz56ilvqk # target_branch: file:///export/home/jl208045/mysql/wl4800/mysql-next-\ # mr-opt-backporting-wl4800-range-subselect/ # testament_sha1: 9d8e7eab28e7f8c0c9bd996d771369ee6ed9fe37 # timestamp: 2011-01-05 09:45:19 +0100 # base_revision_id: jorgen.loland@stripped\ # wlyy01p9uyrd0z8n # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMK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