diff options
-rw-r--r-- | mysql-test/suite/pbxt/r/group_min_max.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/pbxt/r/metadata.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/pbxt/r/subselect.result | 4 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/mysql-test/suite/pbxt/r/group_min_max.result b/mysql-test/suite/pbxt/r/group_min_max.result index 6364cdda357..04f14a9f5e7 100644 --- a/mysql-test/suite/pbxt/r/group_min_max.result +++ b/mysql-test/suite/pbxt/r/group_min_max.result @@ -2256,7 +2256,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 15 Using where +1 PRIMARY t1_outer index NULL a 10 NULL 15 Using where; Using index 2 DEPENDENT SUBQUERY t1 index NULL a 10 NULL 1 Using index EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); diff --git a/mysql-test/suite/pbxt/r/metadata.result b/mysql-test/suite/pbxt/r/metadata.result index b2a8acd8e9b..c46c6e26ce4 100644 --- a/mysql-test/suite/pbxt/r/metadata.result +++ b/mysql-test/suite/pbxt/r/metadata.result @@ -55,7 +55,7 @@ id data data 2 female no select t1.id from t1 union select t2.id from t2; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def id id 1 4 1 Y 49152 0 63 +def id id 1 4 1 Y 32768 0 63 id 1 2 @@ -66,7 +66,7 @@ insert into t1 values (2,'two'); set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg00 @arg00 8 20 1 Y 49152 0 63 +def @arg00 @arg00 8 20 1 Y 32768 0 63 @arg00 1 select * from (select @arg00) aaa; @@ -76,7 +76,7 @@ def aaa @arg00 @arg00 8 20 1 Y 32768 0 63 1 select 1 union select 1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def 1 1 8 20 1 N 49153 0 63 +def 1 1 8 20 1 N 32769 0 63 1 1 select * from (select 1 union select 1) aaa; diff --git a/mysql-test/suite/pbxt/r/subselect.result b/mysql-test/suite/pbxt/r/subselect.result index d2926d454c6..455411c6faf 100644 --- a/mysql-test/suite/pbxt/r/subselect.result +++ b/mysql-test/suite/pbxt/r/subselect.result @@ -3425,13 +3425,13 @@ id select_type table type possible_keys key key_len ref rows Extra ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b -AAA 8 BBB 4 CCC 7 +AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 9 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where 2 DEPENDENT SUBQUERY t1 index NULL a 8 NULL 1 DROP TABLE t1; create table t1( f1 int,f2 int); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8e74640606e..94c78e002fe 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7760,7 +7760,6 @@ bool setup_tables(THD *thd, Name_resolution_context *context, table_list= table_list->next_leaf, tablenr++) { TABLE *table= table_list->table; - table->pos_in_table_list= table_list; if (first_select_table && table_list->top_table() == first_select_table) { @@ -7775,6 +7774,7 @@ bool setup_tables(THD *thd, Name_resolution_context *context, } else { + table->pos_in_table_list= table_list; setup_table_map(table, table_list, tablenr); if (table_list->process_index_hints(table)) |