summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived_opt.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-13 10:26:01 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-13 10:26:01 +0300
commit6e6318b29b446f76f01f2ef65d1460870b607d2a (patch)
tree8c22bb7661b77c91b28532ddd7c150d4bf010146 /mysql-test/main/derived_opt.result
parent450c017c2d9e490d92c949d5164b4a99b6b3f5db (diff)
parente262eb165c197083df9f4986ab54c5b2dcbd6290 (diff)
downloadmariadb-git-6e6318b29b446f76f01f2ef65d1460870b607d2a.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/derived_opt.result')
-rw-r--r--mysql-test/main/derived_opt.result27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/main/derived_opt.result b/mysql-test/main/derived_opt.result
index 48ac7e62653..06e727f95b7 100644
--- a/mysql-test/main/derived_opt.result
+++ b/mysql-test/main/derived_opt.result
@@ -540,4 +540,31 @@ id select_type table type possible_keys key key_len ref rows Extra
set join_cache_level=default;
set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1,t2;
+set @save_optimizer_switch= @@optimizer_switch;
+set optimizer_switch="derived_merge=on";
+CREATE TABLE t1 (id int, d2 datetime, id1 int) ;
+insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3);
+CREATE TABLE t2 (id int, d1 datetime, id1 int) ;
+insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2);
+prepare stmt from "
+SELECT * from
+ (SELECT min(d2) AS d2, min(d1) AS d1 FROM
+ (SELECT t1.d2 AS d2, (SELECT t2.d1
+ FROM t2 WHERE t1.id1 = t2.id1
+ ORDER BY t2.id DESC LIMIT 1) AS d1
+ FROM t1
+ ) dt2
+ ) ca
+ ORDER BY ca.d2;";
+execute stmt;
+d2 d1
+2020-01-01 10:10:10 2020-01-01 10:10:10
+execute stmt;
+d2 d1
+2020-01-01 10:10:10 2020-01-01 10:10:10
+set optimizer_switch= @save_optimizer_switch;
+DROP TABLE t1, t2;
+#
+# End of 10.3 tests
+#
set optimizer_switch=@exit_optimizer_switch;