summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhf@deer.(none) <>2003-11-21 11:58:28 +0400
committerhf@deer.(none) <>2003-11-21 11:58:28 +0400
commiteb08458c553d99cca58fbb41c1949c00a50dca80 (patch)
tree1958030cb2e4fd7b1e8695db55ab95957c4c1eab
parent0a5af4448023fabe2c7294a1ca03e0a6c25e925e (diff)
parenta88f4ea30f378234716e06d64dbc437babe79506 (diff)
downloadmariadb-git-eb08458c553d99cca58fbb41c1949c00a50dca80.tar.gz
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.1727
-rw-r--r--mysql-test/r/derived.result17
-rw-r--r--mysql-test/t/derived.test6
-rw-r--r--sql/sql_lex.cc31
3 files changed, 25 insertions, 29 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 6d322078018..bb268cd1094 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -228,3 +228,20 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
drop table t1;
+create table t1 (a int);
+insert into t1 values (1),(2);
+select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
+a a
+1 1
+2 1
+1 2
+2 2
+explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
+4 DERIVED t1 ALL NULL NULL NULL NULL 2
+5 UNION t1 ALL NULL NULL NULL NULL 2
+2 DERIVED t1 ALL NULL NULL NULL NULL 2
+3 UNION t1 ALL NULL NULL NULL NULL 2
+drop table t1;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index ee50ffda476..caf673d95c1 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -132,3 +132,9 @@ insert into t1 VALUES(1,1,1), (2,2,1);
select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
drop table t1;
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
+explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
+drop table t1;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 981e5e1e026..9b74073b64e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1270,28 +1270,6 @@ bool st_select_lex::test_limit()
return(0);
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/*
Interface method of table list creation for query
@@ -1316,13 +1294,8 @@ bool st_select_lex_unit::create_total_list(THD *thd, st_lex *lex,
bool check_derived)
{
*result= 0;
- for (SELECT_LEX_UNIT *unit= this; unit; unit= unit->next_unit())
- {
- if ((res= unit->create_total_list_n_last_return(thd, lex, &result,
- check_derived)))
- return res;
- }
- return 0;
+ res= create_total_list_n_last_return(thd, lex, &result, check_derived);
+ return res;
}
/*