diff options
author | Varun Gupta <varunraiko1803@gmail.com> | 2018-10-15 09:35:19 -0700 |
---|---|---|
committer | Varun Gupta <varunraiko1803@gmail.com> | 2018-10-16 08:11:26 -0700 |
commit | 97a37edc970f8619ffd23394b61fe310d705d0ef (patch) | |
tree | 8dad954c1cc548bde5be847599654ba29c39c0c2 /mysql-test/main/win_percentile.result | |
parent | 103b1df510599255f464de5c85a8b0ab1bb1283e (diff) | |
download | mariadb-git-97a37edc970f8619ffd23394b61fe310d705d0ef.tar.gz |
MDEV-17137: Syntax errors with VIEW using MEDIAN
The syntax error happened because we had not implemented a different print for
percentile functions. The syntax is a bit different when we use percentile functions
as window functions in comparision to normal window functions.
Implemented a seperate print function for percentile functions
Diffstat (limited to 'mysql-test/main/win_percentile.result')
-rw-r--r-- | mysql-test/main/win_percentile.result | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/main/win_percentile.result b/mysql-test/main/win_percentile.result index f46fad80d16..6ae18488697 100644 --- a/mysql-test/main/win_percentile.result +++ b/mysql-test/main/win_percentile.result @@ -348,3 +348,21 @@ MEDIAN(`a2`) OVER (PARTITION BY `pk`) FROM t1; MEDIAN(`a1`) OVER () MEDIAN(`a2`) OVER (PARTITION BY `pk`) DROP TABLE t1; +# +# MDEV-17137: Syntax errors with VIEW using MEDIAN +# +CREATE TABLE t1(val int); +INSERT INTO t1 VALUES (1), (2), (3); +CREATE VIEW v1 AS SELECT MEDIAN(val) OVER() FROM t1; +select * from v1; +MEDIAN(val) OVER() +2.0000000000 +2.0000000000 +2.0000000000 +select median(val) OVER () FROM t1; +median(val) OVER () +2.0000000000 +2.0000000000 +2.0000000000 +drop table t1; +drop view v1; |