summaryrefslogtreecommitdiff
path: root/mysql-test/main/opt_trace.result
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2020-06-15 12:59:53 +0300
committerSergei Petrunia <psergey@askmonty.org>2020-06-15 13:00:43 +0300
commit517e9334f2a0f0d70cb139deb110213536dbb96d (patch)
tree75d8bfa2b2ac97927d8d7c172877224477dbf575 /mysql-test/main/opt_trace.result
parentc9f5cb97af6d3ef853f84a19602efea715016734 (diff)
downloadmariadb-git-517e9334f2a0f0d70cb139deb110213536dbb96d.tar.gz
MDEV-22891: Optimizer trace: const tables are not clearly visible
Make mark_join_nest_as_const() print its action into the trace.
Diffstat (limited to 'mysql-test/main/opt_trace.result')
-rw-r--r--mysql-test/main/opt_trace.result31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result
index ad7bce44445..6af1c2afe9e 100644
--- a/mysql-test/main/opt_trace.result
+++ b/mysql-test/main/opt_trace.result
@@ -8530,5 +8530,36 @@ select count(*) from seq_1_to_10000000 {
}
]
} 0 0
+#
+# MDEV-22891: Optimizer trace: const tables are not clearly visible
+#
+create table t0(a int primary key);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (pk int primary key, a int);
+insert into t1 select a,a from t0;
+create table t2 (pk int primary key, a int);
+insert into t2 select a,a from t0;
+create table t3 (pk int primary key, a int);
+insert into t3 select a,a from t0;
+explain
+select * from t1 left join (t2 join t3 on t3.pk=1000) on t2.a=t1.a and t2.pk is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t2 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.mark_join_nest_as_const'))
+from information_schema.optimizer_trace;
+JSON_DETAILED(JSON_EXTRACT(trace, '$**.mark_join_nest_as_const'))
+[
+
+ {
+ "members":
+ [
+ "t3",
+ "t2"
+ ]
+ }
+]
+drop table t0, t1, t2, t3;
# End of 10.5 tests
set optimizer_trace='enabled=off';