diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-02-10 21:33:14 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-02-10 21:33:14 +0100 |
commit | 7dade0adbd254a37cd41d0e2eb2adb7918517349 (patch) | |
tree | 7f0c4ce563f4d2b83ca4e02c64e7111abb1347a3 /mysql-test/main/win.result | |
parent | 8c7c92adf384b2d0294502d5b38684e68d5eaf27 (diff) | |
parent | 65f602310c4ea086488bfaa50f36952162541a8c (diff) | |
download | mariadb-git-7dade0adbd254a37cd41d0e2eb2adb7918517349.tar.gz |
Merge branch '10.7' into 10.8mariadb-10.8.2
Diffstat (limited to 'mysql-test/main/win.result')
-rw-r--r-- | mysql-test/main/win.result | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result index b1e04fadb3a..1cf03adb887 100644 --- a/mysql-test/main/win.result +++ b/mysql-test/main/win.result @@ -4277,6 +4277,38 @@ drop procedure sp7; drop view v1,v2; drop table t1; # +# MDEV-17785: Window functions not working in ONLY_FULL_GROUP_BY mode +# +CREATE TABLE t1(a VARCHAR(10), b int); +INSERT INTO t1 VALUES +('Maths', 60),('Maths', 60), +('Maths', 70),('Maths', 55), +('Biology', 60), ('Biology', 70); +SET @save_sql_mode= @@sql_mode; +SET sql_mode = 'ONLY_FULL_GROUP_BY'; +SELECT +RANK() OVER (PARTITION BY a ORDER BY b) AS rank, +a, b FROM t1 ORDER BY a, b DESC; +rank a b +2 Biology 70 +1 Biology 60 +4 Maths 70 +2 Maths 60 +2 Maths 60 +1 Maths 55 +SET sql_mode= @save_sql_mode; +DROP TABLE t1; +CREATE TABLE t1(i int,j int); +INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4); +INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4); +SELECT i, LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j) FROM t1 GROUP BY i; +i LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j) +1 6 +2 4 +3 2 +4 2 +DROP TABLE t1; +# # End of 10.2 tests # # |