summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/win_orderby.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:04:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:04:16 +0000
commita68fb2d8219f6bccc573009600e9f23e89226a5e (patch)
treed742d35d14ae816e99293d2b01face30e9f3a46b /mysql-test/main/win_orderby.test
parentInitial commit. (diff)
downloadmariadb-10.6-a68fb2d8219f6bccc573009600e9f23e89226a5e.tar.xz
mariadb-10.6-a68fb2d8219f6bccc573009600e9f23e89226a5e.zip
Adding upstream version 1:10.6.11.upstream/1%10.6.11upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/win_orderby.test')
-rw-r--r--mysql-test/main/win_orderby.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/main/win_orderby.test b/mysql-test/main/win_orderby.test
new file mode 100644
index 00000000..7f02a582
--- /dev/null
+++ b/mysql-test/main/win_orderby.test
@@ -0,0 +1,35 @@
+#
+# Tests for window functions and ORDER BY
+#
+
+--disable_warnings
+drop table if exists t0,t1;
+--enable_warnings
+
+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,
+ a int,
+ key(pk)
+);
+
+insert into t1
+select
+ A.a + B.a* 10 + C.a * 100,
+ 1
+from t0 A, t0 B, t0 C;
+
+#enable after fix MDEV-27871
+--disable_view_protocol
+select
+ pk,
+ count(a) over (order by pk rows between 2 preceding and 2 following)
+from t1
+where pk between 1 and 30
+order by pk desc
+limit 4;
+--disable_view_protocol
+
+drop table t0,t1;