From ff09512e07045b0997265d37c45f075daebe9531 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 20 Jun 2018 19:36:37 +0400 Subject: MDEV-16489 when lead() returns null on a datetime field, the result is treated as the literal string '[NULL]' --- mysql-test/main/win.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/main/win.test') diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test index d483cdbaa83..4b73f70d737 100644 --- a/mysql-test/main/win.test +++ b/mysql-test/main/win.test @@ -2086,3 +2086,17 @@ DROP TABLE t1,t2; --echo # --echo # Start of 10.3 tests --echo # + +--echo # +--echo # MDEV-16489 when lead() returns null on a datetime field, the result is treated as the literal string '[NULL]' +--echo # + +CREATE TABLE t1 (d datetime); +INSERT INTO t1 VALUES ('2018-01-01 00:00:00'),('2018-02-01 00:00:00'); +SELECT *, LEAD(d) OVER (ORDER BY d) AS x FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (d time); +INSERT INTO t1 VALUES ('00:00:01'),('00:00:02'); +SELECT *, LEAD(d) OVER (ORDER BY d) AS x FROM t1; +DROP TABLE t1; -- cgit v1.2.1