Below is the list of changes that have just been committed into a local
5.2 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@1.2599, 2007-10-12 06:41:09+04:00, sergefp@mysql.com +3 -0
WL#3740: Fix: Make eq_ref-based table pull-out be transitive.
mysql-test/r/subselect.result@1.188, 2007-10-12 06:41:04+04:00, sergefp@mysql.com +2 -2
Update testcase results (checked)
mysql-test/r/subselect_sj.result@1.5, 2007-10-12 06:41:04+04:00, sergefp@mysql.com +3 -3
Update testcase results (checked)
sql/sql_select.cc@1.561, 2007-10-12 06:41:04+04:00, sergefp@mysql.com +8 -5
WL#3740: Fix: Make eq_ref-based table pull-out be transitive.
- when calling find_eq_ref_table(), pass the bitmap of remaining
sj-inner tables, not of the tables that were originally sj-inner.
- in select_describe(), in "Extra" column calculation, let examined_rows
be of type double, because overwise we get bogus results caused by
rounding errors.
diff -Nrup a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
--- a/mysql-test/r/subselect.result 2007-08-26 11:55:00 +04:00
+++ b/mysql-test/r/subselect.result 2007-10-12 06:41:04 +04:00
@@ -1316,9 +1316,9 @@ explain extended select * from t2 where
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index; FirstMatch(t1)
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))
+Note 1003 select `test`.`t2`.`a` AS `a` from (`test`.`t1` join `test`.`t3`) join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`b`))
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
diff -Nrup a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
--- a/mysql-test/r/subselect_sj.result 2007-06-30 23:11:58 +04:00
+++ b/mysql-test/r/subselect_sj.result 2007-10-12 06:41:04 +04:00
@@ -47,7 +47,7 @@ explain select * from t1 where a in (sel
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1
-1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 Using index; FirstMatch(t10)
+1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 Using index
select * from t1 where a in (select pk from t10 where t10.a in (select pk from t12));
a b
0 0
@@ -58,9 +58,9 @@ explain extended select * from t1 where
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00
-1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 100.00 Using index; FirstMatch(t10)
+1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t10` join `test`.`t12`) where ((`test`.`t10`.`pk` = `test`.`t1`.`a`) and (`test`.`t12`.`pk` = `test`.`t10`.`a`))
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (`test`.`t10` join `test`.`t12`) join `test`.`t1` where ((`test`.`t10`.`pk` = `test`.`t1`.`a`) and (`test`.`t12`.`pk` = `test`.`t10`.`a`))
subqueries within outer joins go into ON expr.
explAin extended
select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10));
diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
--- a/sql/sql_select.cc 2007-09-26 15:47:43 +04:00
+++ b/sql/sql_select.cc 2007-10-12 06:41:04 +04:00
@@ -3554,7 +3554,9 @@ int pull_out_semijoin_tables(JOIN *join)
{
if (tbl->table && !(pulled_tables & tbl->table->map))
{
- if (find_eq_ref_candidate(tbl->table, sj_nest->nested_join->used_tables))
+ if (find_eq_ref_candidate(tbl->table,
+ sj_nest->nested_join->used_tables &
+ ~pulled_tables))
{
pulled_a_table= TRUE;
pulled_tables |= tbl->table->map;
@@ -18436,13 +18438,14 @@ void select_describe(JOIN *join, bool ne
}
else
{
- ha_rows examined_rows;
+ double examined_rows;
if (tab->select && tab->select->quick)
- examined_rows= tab->select->quick->records;
+ examined_rows= rows2double(tab->select->quick->records);
else if (tab->type == JT_NEXT || tab->type == JT_ALL)
- examined_rows= tab->limit ? tab->limit : tab->table->file->records();
+ examined_rows= rows2double(tab->limit ? tab->limit :
+ tab->table->file->records());
else
- examined_rows=(ha_rows)join->best_positions[i].records_read;
+ examined_rows= join->best_positions[i].records_read;
item_list.push_back(new Item_int((longlong) (ulonglong) examined_rows,
MY_INT64_NUM_DECIMAL_DIGITS));
--
MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits
To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Fri Oct 12 00:41:18 2007