diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2020-12-14 14:34:14 +0530 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2022-02-22 06:38:40 +0300 |
commit | 647e952315740286df3cf6643732ad8deb1ff7fe (patch) | |
tree | ca98d3c7b70d43c0c10d949301c8e103cb125f9c | |
parent | 942a9791b2231273ba20649a658c856641268fae (diff) | |
download | mariadb-git-647e952315740286df3cf6643732ad8deb1ff7fe.tar.gz |
MDEV-15208: server crashed, when using ORDER BY with window function and UNION
(Edits by SergeiP: fix encryption.tempfiles_encrypted, re-word comment)
Global ORDER BY clause of a UNION may not refer to 1) aggregate functions
or 2) window functions. setup_order() checked for #1 but not for #2.
-rw-r--r-- | mysql-test/suite/encryption/r/tempfiles_encrypted.result | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result index aaba6bb044a..f7b5081f625 100644 --- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result +++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result @@ -4236,6 +4236,14 @@ i LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j) 4 2 DROP TABLE t1; # +# MDEV-15208: server crashed, when using ORDER BY with window function and UNION +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(2),(2),(2),(2),(2); +SELECT 1 UNION SELECT a FROM t1 ORDER BY (row_number() over ()); +ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION +DROP TABLE t1; +# # End of 10.2 tests # # |