[Commits] 0046f1d: Add test case for new window functions status var

Vicentiu Ciorbaru vicentiu at mariadb.org
Mon Sep 19 22:12:00 EEST 2016


revision-id: 0046f1de97242a37363651409a9a9b110732b311 (mariadb-10.1.8-271-g0046f1d)
parent(s): d3ab7428c068291b48b1354469bed85fc36d7add
author: Vicențiu Ciorbaru
committer: Vicențiu Ciorbaru
timestamp: 2016-09-19 21:11:26 +0200
message:

Add test case for new window functions status var

---
 mysql-test/r/win_i_s.result | 38 ++++++++++++++++++++++++++++++++++++++
 mysql-test/t/win_i_s.test   | 18 ++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/mysql-test/r/win_i_s.result b/mysql-test/r/win_i_s.result
new file mode 100644
index 0000000..8678c45
--- /dev/null
+++ b/mysql-test/r/win_i_s.result
@@ -0,0 +1,38 @@
+show status like '%window%';
+Variable_name	Value
+Feature_window_functions	0
+create table t1 (a int, b int);
+insert into t1 values (1, 10), (2, 20), (3, 30);
+select a, b, rank() over (order by a) from t1;
+a	b	rank() over (order by a)
+1	10	1
+2	20	2
+3	30	3
+show status like '%window%';
+Variable_name	Value
+Feature_window_functions	1
+select a, b, rank() over (order by a), sum(a) over (order by a) from t1;
+a	b	rank() over (order by a)	sum(a) over (order by a)
+1	10	1	1
+2	20	2	3
+3	30	3	6
+show status like '%window%';
+Variable_name	Value
+Feature_window_functions	2
+select t_a.r1, t_b.r2
+from (select a, b, rank() over (order by a) as r1 from t1) t_a,
+(select a, b, row_number() over (order by a) as r2 from t1) t_b;
+r1	r2
+1	1
+1	2
+1	3
+2	1
+2	2
+2	3
+3	1
+3	2
+3	3
+show status like '%window%';
+Variable_name	Value
+Feature_window_functions	4
+drop table t1;
diff --git a/mysql-test/t/win_i_s.test b/mysql-test/t/win_i_s.test
new file mode 100644
index 0000000..d9b0f19
--- /dev/null
+++ b/mysql-test/t/win_i_s.test
@@ -0,0 +1,18 @@
+show status like '%window%';
+
+create table t1 (a int, b int);
+insert into t1 values (1, 10), (2, 20), (3, 30);
+
+select a, b, rank() over (order by a) from t1;
+show status like '%window%';
+
+select a, b, rank() over (order by a), sum(a) over (order by a) from t1;
+show status like '%window%';
+
+--sorted_result
+select t_a.r1, t_b.r2
+from (select a, b, rank() over (order by a) as r1 from t1) t_a,
+     (select a, b, row_number() over (order by a) as r2 from t1) t_b;
+show status like '%window%';
+
+drop table t1;


More information about the commits mailing list