summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2010-06-11 16:57:41 +0400
committerSergey Petrunya <psergey@askmonty.org>2010-06-11 16:57:41 +0400
commit03904127821b430628bcefedff0ed52fcb8f2256 (patch)
treed000c8652f160aaeb4f18361487188ba8e436c2b
parent9316a60b2c3d6d3c2ffeaae8201c27d9f0bfa9de (diff)
downloadmariadb-git-03904127821b430628bcefedff0ed52fcb8f2256.tar.gz
Fix test results and testuite valgrind failures
-rw-r--r--mysql-test/r/subselect_mat.result8
-rw-r--r--mysql-test/r/subselect_sj_mat.result6
-rw-r--r--mysql-test/t/subselect_sj_mat.test4
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/sql_select.cc7
5 files changed, 16 insertions, 11 deletions
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index 3a41da4e9db..076dba8fc50 100644
--- a/mysql-test/r/subselect_mat.result
+++ b/mysql-test/r/subselect_mat.result
@@ -83,8 +83,8 @@ a1 a2
explain extended
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where; Using_where_or_index
-2 SUBQUERY t2i index it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; Using_where_or_index
+1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where;
+2 SUBQUERY t2i index it2i1,it2i3 it2i1 # NULL 5 100.00 Using where;
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>(`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( <materialize> (select `test`.`t2i`.`b1` AS `b1` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where ((`test`.`t1i`.`a1` = `<subquery2>`.`b1`)))))
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
@@ -105,8 +105,8 @@ a1 a2
explain extended
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i index NULL it1i3 18 NULL 3 100.00 Using where; Using index
-2 SUBQUERY t2i index it2i1,it2i3 it2i3 18 NULL 5 100.00 Using where; Using index
+1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where;
+2 SUBQUERY t2i index it2i1,it2i3 it2i3 # NULL 5 100.00 Using where;
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (select `test`.`t2i`.`b1` AS `b1`,`test`.`t2i`.`b2` AS `b2` from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where ((`test`.`t1i`.`a1` = `<subquery2>`.`b1`) and (`test`.`t1i`.`a2` = `<subquery2>`.`b2`)))))
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result
index 25f2c46acb5..ea91ad8a63c 100644
--- a/mysql-test/r/subselect_sj_mat.result
+++ b/mysql-test/r/subselect_sj_mat.result
@@ -87,7 +87,7 @@ explain extended
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2i index it2i1,it2i3 it2i1 # NULL 5 40.00 Using where; Using index; LooseScan
-1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 100.00 Using_where_or_index
+1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 100.00
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` > '0'))
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
@@ -109,8 +109,8 @@ a1 a2
explain extended
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 40.00 Using where; Using index; LooseScan
-1 PRIMARY t1i ref it1i1,it1i2,it1i3 it1i3 18 test.t2i.b1,test.t2i.b2 1 100.00 Using index
+1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 40.00 Using where; Using index; LooseScan
+1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 100.00
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where ((`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` > '0'))
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test
index bd4e43a06ee..dfaf6fb412e 100644
--- a/mysql-test/t/subselect_sj_mat.test
+++ b/mysql-test/t/subselect_sj_mat.test
@@ -71,7 +71,7 @@ select * from t1 where (a1, a2) in (select b1, min(b2) from t2 where b1 > '0' gr
# indexed columns
--replace_column 7 #
---replace_regex /it1.*/_it1_idx/ /test.t2i.*/_ref_/ /Using index$/Using_where_or_index/ /Using where$/Using_where_or_index/
+--replace_regex /it1.*/_it1_idx/ /test.t2i.*/_ref_/ /Using index$// /Using where$//
explain extended
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
@@ -81,6 +81,8 @@ explain extended
select * from t1i where a1 in (select b1 from t2i where b1 > '0' group by b1);
select * from t1i where a1 in (select b1 from t2i where b1 > '0' group by b1);
+--replace_column 7 #
+--replace_regex /it1.*/_it1_idx/ /test.t2i.*/_ref_/ /Using index$// /Using where$//
explain extended
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 030b5496315..ad67e98ba23 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -2195,7 +2195,7 @@ bool Item_in_subselect::init_left_expr_cache()
Item::result_field. In the case end_[send | write]_group result_field is
one row behind field.
*/
- end_select= outer_join->join_tab[outer_join->tables-1].next_select;
+ end_select= outer_join->join_tab[outer_join->top_jtrange_tables-1].next_select;
if (end_select == end_send_group || end_select == end_write_group)
use_result_field= TRUE;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 17edca4864a..34e91d99f77 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10402,6 +10402,9 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
for (i= first_tab; i <= last_tab; i++)
reopt_remaining_tables |= join->positions[i].table->table->map;
+ table_map save_cur_sj_inner_tables= join->cur_sj_inner_tables;
+ join->cur_sj_inner_tables= 0;
+
for (i= first_tab; i <= last_tab; i++)
{
JOIN_TAB *rs= join->positions[i].table;
@@ -10427,6 +10430,7 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
if (rs->emb_sj_nest)
inner_fanout *= pos.records_read;
}
+ join->cur_sj_inner_tables= save_cur_sj_inner_tables;
*reopt_rec_count= rec_count;
*reopt_cost= cost;
@@ -11431,7 +11435,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
for distinct, as we want the distinct index to be
usable in this case too.
*/
- item->marker == 4 || param->bit_fields_as_long, // psergey-feb17
+ item->marker == 4 || param->bit_fields_as_long,
force_copy_fields,
param->convert_blob_length);
@@ -11772,7 +11776,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
indexes on blobs with arbitrary length. Such indexes cannot be
used for lookups.
*/
- //// psergey-merge: using_unique_constraint=1;
share->uniques= 1;
}
null_pack_length-=hidden_null_pack_length;