diff options
author | unknown <bell@sanja.is.com.ua> | 2003-10-17 15:18:57 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-10-17 15:18:57 +0300 |
commit | 6795b2642b155e64e73aa7571f30b84b090c3636 (patch) | |
tree | 61860c9d0fd0b65720c9c2e02f86c909b29c5a39 /mysql-test | |
parent | d894f23372ad7abd1efd108562574b4d15dd0709 (diff) | |
download | mariadb-git-6795b2642b155e64e73aa7571f30b84b090c3636.tar.gz |
fixed deleting derived table tree after using (BUG#1536)
mysql-test/r/subselect.result:
fixed drop table statement
test for BUG#1536
mysql-test/t/subselect.test:
fixed drop table statement
test for BUG#1536
sql/sql_derived.cc:
all tree of derived table should be deleted
sql/sql_lex.cc:
delete subtree method
sql/sql_lex.h:
delete subtree method
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect.result | 9 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 6e35b6e78c1..a2460b8f11a 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1438,4 +1438,11 @@ explain select * from t3 where a > all (select max(b) from t2 group by a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort -drop table if exists t2, t3; +drop table t2, t3; +create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1) +); +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; +count(*) +2 +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 9ba91c7e0a6..afc2d1a9328 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -964,4 +964,13 @@ explain select * from t3 where a >= all (select b from t2); insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); explain select * from t3 where a > all (select max(b) from t2 group by a); -drop table if exists t2, t3; +drop table t2, t3; + +# +# deived tables with subquery inside all by one table +# +create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1) +); +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; +drop table t1; |