summaryrefslogtreecommitdiff
path: root/mysql-test/r/derived.result
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2003-10-19 14:25:33 +0300
committerbell@sanja.is.com.ua <>2003-10-19 14:25:33 +0300
commit9d294b869e6f092a6baa28b26f3ba3835dc9890d (patch)
treed43b31d4c802179e6588987ef6add594f2e40239 /mysql-test/r/derived.result
parent2586a56be5998bbe716f3fa7d0ba2a9b92dfdfad (diff)
downloadmariadb-git-9d294b869e6f092a6baa28b26f3ba3835dc9890d.tar.gz
correct table name assigned to temporary table field:
- correct table name shown in EXPLAIN Iindex reference) - pointer on freed memmory (reallocation of table name in reusing table entry) can't be used in EXPLAIN (BUG#1584)
Diffstat (limited to 'mysql-test/r/derived.result')
-rw-r--r--mysql-test/r/derived.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index d24ac5e898a..12d8bbaf8ae 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -215,3 +215,18 @@ ERROR 42000: You have an error in your SQL syntax. Check the manual that corres
insert into (select * from t1) values (5);
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1
drop table t1;
+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
+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;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 THEMAX.E2 1 Using where
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
+Warnings:
+Note 1275 Field or reference 'A.E2' of SELECT #3 was resolved in SELECT #2
+drop table t1;