[Commits] 457f3b99413e50c7cf393b06a86483e1854d86c8 Added the test case for bug mdev-9941 that was fixed some time ago.

Igor Babaev igor at askmonty.org
Sat Sep 24 00:42:12 EEST 2016


commit 457f3b99413e50c7cf393b06a86483e1854d86c8
Author: Igor Babaev <igor at askmonty.org>
Commit: Igor Babaev <igor at askmonty.org>

    Added the test case for bug mdev-9941 that was fixed some time ago.
---
 mysql-test/r/win.result |   43 +++++++++++++++++++++++++++++++++++++++++++
 mysql-test/t/win.test   |   27 +++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result
index 4d9c58c..233308c 100644
--- a/mysql-test/r/win.result
+++ b/mysql-test/r/win.result
@@ -2142,3 +2142,46 @@ pk	a	d	sum_1	sum_2
 10	2	0.800	1.700	2.400
 11	2	0.900	0.900	2.800
 drop table t1;
+#
+# MDEV-9941: two window functions with compatible partitions 
+#
+create table t1 (
+a int,
+b int,
+c int
+);
+insert into t1 values 
+(10, 1, 1),
+(10, 3, 10),
+(10, 1, 10),
+(10, 3, 100),
+(10, 5, 1000),
+(10, 1, 100);
+explain format=json
+select 
+a,b,c,
+row_number() over (partition by a),
+row_number() over (partition by a, b)
+from t1;
+EXPLAIN
+{
+  "query_block": {
+    "select_id": 1,
+    "window_functions_computation": {
+      "sorts": {
+        "filesort": {
+          "sort_key": "t1.a, t1.b"
+        }
+      },
+      "temporary_table": {
+        "table": {
+          "table_name": "t1",
+          "access_type": "ALL",
+          "rows": 6,
+          "filtered": 100
+        }
+      }
+    }
+  }
+}
+drop table t1;
diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test
index 10c673a..60bd42e 100644
--- a/mysql-test/t/win.test
+++ b/mysql-test/t/win.test
@@ -1310,3 +1310,30 @@ select pk, a, d,
 from t1;
 
 drop table t1;
+
+--echo #
+--echo # MDEV-9941: two window functions with compatible partitions 
+--echo #
+
+create table t1 (
+  a int,
+  b int,
+  c int
+);
+ 
+insert into t1 values 
+ (10, 1, 1),
+ (10, 3, 10),
+ (10, 1, 10),
+ (10, 3, 100),
+ (10, 5, 1000),
+ (10, 1, 100);
+
+explain format=json
+select 
+  a,b,c,
+  row_number() over (partition by a),
+  row_number() over (partition by a, b)
+from t1;
+
+drop table t1;


More information about the commits mailing list