summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorzhzhzoo <zhzhzoo@gmail.com>2018-03-17 01:22:53 +0800
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-08-25 18:47:14 +0300
commit2a361ebe1b9c52eadfe811a219a89df6a0d6e3ea (patch)
treec7412974df44d3b7a9f01fe3e9a8a269a057a664 /mysql-test/t
parentc826b6b8da3c9ee89ab457155bae96310213e5a1 (diff)
downloadmariadb-git-2a361ebe1b9c52eadfe811a219a89df6a0d6e3ea.tar.gz
MDEV-15204: lag/lead function order list mandatory
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/win.test4
-rw-r--r--mysql-test/t/win_lead_lag.test13
2 files changed, 15 insertions, 2 deletions
diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test
index b354a55d0d6..f47237ee59e 100644
--- a/mysql-test/t/win.test
+++ b/mysql-test/t/win.test
@@ -2000,8 +2000,8 @@ DROP TABLE fv_test, fv_result;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (0),(1),(2);
-SELECT LEAD(a) OVER (PARTITION BY a) as lead,
- a AND LEAD(a) OVER (PARTITION BY a) AS a_and_lead_part
+SELECT LEAD(a) OVER (PARTITION BY a ORDER BY a) as lead,
+ a AND LEAD(a) OVER (PARTITION BY a ORDER BY a) AS a_and_lead_part
FROM t1;
SELECT a OR LEAD(a) OVER (ORDER BY a) AS a_or_lead_order
diff --git a/mysql-test/t/win_lead_lag.test b/mysql-test/t/win_lead_lag.test
index 2824f83789c..d154244ecd0 100644
--- a/mysql-test/t/win_lead_lag.test
+++ b/mysql-test/t/win_lead_lag.test
@@ -107,4 +107,17 @@ select pk, a, b, a+b,
from t1
order by pk asc;
+--echo #
+--echo # MDEV-15204 - LAG function doesn't require ORDER BY in OVER clause
+--echo #
+--error ER_NO_ORDER_LIST_IN_WINDOW_SPEC
+select pk,
+ lag(pk, 1) over ()
+from t1;
+
+--error ER_NO_ORDER_LIST_IN_WINDOW_SPEC
+select pk,
+ lead(pk, 1) over ()
+from t1;
+
drop table t1;