#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": "<in_optimizer>(5,<exists>(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(5) = 2))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>(5,<exists>(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(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": "<in_optimizer>((`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": "<in_optimizer>((`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": "<nop>((`test`.`t1`.`s1` > (/* select#2 */ select min(`test`.`t1`.`s2`) from `test`.`t1`)))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<nop>((`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": "<nop>((`test`.`t1`.`s1` > <min>(/* select#2 */ select max(`test`.`t1`.`s2`) from `test`.`t1`)))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<nop>((`test`.`t1`.`s1` > <min>(/* 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": "<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select 1 from `test`.`t1` where (<cache>(`test`.`t1`.`s1`) = `test`.`t1`.`s2`)))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select 1 from `test`.`t1` where (<cache>(`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": "<in_optimizer>((`test`.`t1`.`s1`,`test`.`t1`.`s2`),<exists>(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where ((<cache>(`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and (<cache>(`test`.`t1`.`s2`) = `test`.`t1`.`s1`))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>((`test`.`t1`.`s1`,`test`.`t1`.`s2`),<exists>(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where ((<cache>(`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and (<cache>(`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": "<in_optimizer>(`test`.`t1_16`.`a1`,<exists>(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and (<cache>(`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>(`test`.`t1_16`.`a1`,<exists>(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and (<cache>(`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": "(<in_optimizer>(`test`.`t2`.`c2`,<exists>(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and (<cache>(`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": "(<in_optimizer>(`test`.`t2`.`c2`,<exists>(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and (<cache>(`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": "(<in_optimizer>(concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and <in_optimizer>(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": "(<in_optimizer>(concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and <in_optimizer>(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(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(/* 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, ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, ((<cache>(`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, <is_not_null_test>(`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, <is_not_null_test>(`test`.`t2`.`d`), true))))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "(not(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(/* 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, ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, ((<cache>(`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, <is_not_null_test>(`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, <is_not_null_test>(`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": "<in_optimizer>(5,<exists>(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(5) = 2))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>(5,<exists>(/* select#2 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(5) = 1)) union /* select#3 */ select 1 from `test`.`t6` where ((`test`.`t6`.`d` = ifnull(`test`.`t5`.`c`,NULL)) and (<cache>(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": "<in_optimizer>((`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": "<in_optimizer>((`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": "<nop>((`test`.`t1`.`s1` > (/* select#2 */ select min(`test`.`t1`.`s2`) from `test`.`t1`)))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<nop>((`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": "<nop>((`test`.`t1`.`s1` > <min>(/* select#2 */ select max(`test`.`t1`.`s2`) from `test`.`t1`)))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<nop>((`test`.`t1`.`s1` > <min>(/* 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": "<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select 1 from `test`.`t1` where (<cache>(`test`.`t1`.`s1`) = `test`.`t1`.`s2`)))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select 1 from `test`.`t1` where (<cache>(`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": "<in_optimizer>((`test`.`t1`.`s1`,`test`.`t1`.`s2`),<exists>(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where ((<cache>(`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and (<cache>(`test`.`t1`.`s2`) = `test`.`t1`.`s1`))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>((`test`.`t1`.`s1`,`test`.`t1`.`s2`),<exists>(/* select#2 */ select `test`.`t1`.`s2`,`test`.`t1`.`s1` from `test`.`t1` where ((<cache>(`test`.`t1`.`s1`) = `test`.`t1`.`s2`) and (<cache>(`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": "<in_optimizer>(`test`.`t1_16`.`a1`,<exists>(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and (<cache>(`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1`))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<in_optimizer>(`test`.`t1_16`.`a1`,<exists>(/* select#2 */ select 1 from `test`.`t2_16` where ((`test`.`t2_16`.`b1` > '0') and (<cache>(`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": "(<in_optimizer>(`test`.`t2`.`c2`,<exists>(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and (<cache>(`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": "(<in_optimizer>(`test`.`t2`.`c2`,<exists>(/* select#2 */ select 1 from `test`.`t2` where ((`test`.`t2`.`c2` = 1) and (<cache>(`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": "(<in_optimizer>(concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and <in_optimizer>(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": "(<in_optimizer>(concat(`test`.`t1`.`c1`,'x'),concat(`test`.`t1`.`c1`,'x') in (/* select#2 */ select left(`test`.`t2`.`c2`,8) from `test`.`t2`)) and <in_optimizer>(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(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(/* 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, ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, ((<cache>(`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, <is_not_null_test>(`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, <is_not_null_test>(`test`.`t2`.`d`), true))))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "(not(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(/* 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, ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`c`) or isnull(`test`.`t2`.`c`)), true) and trigcond_if(outer_field_is_not_null, ((<cache>(`test`.`t1`.`b`) = `test`.`t2`.`d`) or isnull(`test`.`t2`.`d`)), true)) having (trigcond_if(outer_field_is_not_null, <is_not_null_test>(`test`.`t2`.`c`), true) and trigcond_if(outer_field_is_not_null, <is_not_null_test>(`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": "<not>(<in_optimizer>(`test`.`t1`.`topic`,<exists>(/* select#2 */ select `test`.`t1`.`topic` from `test`.`t1` group by `test`.`t1`.`topic` having (<cache>(`test`.`t1`.`topic`) <> <ref_null_helper>(`test`.`t1`.`topic`)))))",
- "evaluate_subselect_cond_steps": [
- ] /* evaluate_subselect_cond_steps */,
"after_constant_propagation": "<not>(<in_optimizer>(`test`.`t1`.`topic`,<exists>(/* select#2 */ select `test`.`t1`.`topic` from `test`.`t1` group by `test`.`t1`.`topic` having (<cache>(`test`.`t1`.`topic`) <> <ref_null_helper>(`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<COND_CMP> *) 0, conds, conds);
- }
+ /* change field = field to field = const for each found field = const */
+ propagate_cond_constants(thd, (I_List<COND_CMP> *) 0, conds, conds);
/*
Remove all instances of item == item
Remove all and-levels where CONST item != CONST item
Attachment: [text/bzr-bundle] bzr/jorgen.loland@oracle.com-20110105084513-2ld14u8dz56ilvqk.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-bugfixing branch (jorgen.loland:3244) | Jorgen Loland | 5 Jan |