summaryrefslogtreecommitdiff
path: root/mysql-test/r/win.result
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-03-28 18:38:42 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-03-28 18:38:42 +0300
commite88758330c49b40556a1f9c3d316b66ce11ca67d (patch)
tree4752c3086f6f1a42fac10664dd5a88966f532743 /mysql-test/r/win.result
parent44fdb56c977259b2801c612116813beda403df78 (diff)
downloadmariadb-git-e88758330c49b40556a1f9c3d316b66ce11ca67d.tar.gz
Make window functions computation step show up in EXPLAIN FORMAT=JSON output
Diffstat (limited to 'mysql-test/r/win.result')
-rw-r--r--mysql-test/r/win.result73
1 files changed, 73 insertions, 0 deletions
diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result
index 4692a3f76cc..82b04e17116 100644
--- a/mysql-test/r/win.result
+++ b/mysql-test/r/win.result
@@ -1401,3 +1401,76 @@ pk c CNT
9 2 4
10 2 3
drop table t0,t1;
+#
+# EXPLAIN FORMAT=JSON support for window functions
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+explain format=json select rank() over (order by a) from t0;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "window_functions_computation": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t0",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+create table t1 (a int, b int, c int);
+insert into t1 select a,a,a from t0;
+explain format=json
+select
+a,
+rank() over (order by sum(b))
+from t1
+group by a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "filesort": {
+ "window_functions_computation": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ }
+ }
+}
+explain format=json
+select
+a,
+rank() over (order by sum(b))
+from t1
+group by a
+order by null;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "window_functions_computation": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+drop table t1;
+drop table t0;