summaryrefslogtreecommitdiff
path: root/mysql-test/r/win.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-07-04 15:31:25 +0400
committerAlexander Barkov <bar@mariadb.org>2017-07-04 15:31:25 +0400
commit5c0df0e4a89b12813cef665533e852a50ecaafae (patch)
treeb75df302abedca56d679ef04a019fac3a5fc7dbc /mysql-test/r/win.result
parent25ad623d64ebc34093544875e5b0ebd6101e975b (diff)
parentad2d722acd7bd7a816dff7838f3fa2dcaaeec8da (diff)
downloadmariadb-git-5c0df0e4a89b12813cef665533e852a50ecaafae.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'mysql-test/r/win.result')
-rw-r--r--mysql-test/r/win.result42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result
index 3aece252991..4a06a8382c4 100644
--- a/mysql-test/r/win.result
+++ b/mysql-test/r/win.result
@@ -3086,6 +3086,48 @@ max(id) rank() over (order by max(id))
2 1
drop table t1;
#
+# main.win failure post MDEV-12336
+#
+create table t(a decimal(35,10), b int);
+insert into t values (1, 10), (2, 20), (3, 30);
+prepare stmt from "SELECT (CASE WHEN sum(t.a) over (partition by t.b)=1 THEN 1000 ELSE 300 END) AS a FROM t";
+execute stmt;
+a
+1000
+300
+300
+drop table t;
+#
+# MDEV-12851 case with window functions query crashes server
+#
+create table t1(dt datetime);
+insert into t1 values ('2017-05-17'), ('2017-05-18');
+select dt,
+case when (max(dt) over (order by dt rows between 1 following and 1 following) is null)
+then '9999-12-31 12:00:00'
+ else max(dt) over (order by dt rows between 1 following and 1 following)
+end x,
+case when (max(dt) over (order by dt rows between 1 following and 1 following) is not null)
+then '9999-12-31 12:00:00'
+ else max(dt) over (order by dt rows between 1 following and 1 following)
+end x
+from t1;
+dt x x
+2017-05-17 00:00:00 2017-05-18 00:00:00 9999-12-31 12:00:00
+2017-05-18 00:00:00 9999-12-31 12:00:00 NULL
+drop table t1;
+create table t1(i int);
+insert into t1 values (null),(1),(2);
+select max(i) over (order by i),
+max(i) over (order by i) is null,
+max(i) over (order by i) is not null
+from t1;
+max(i) over (order by i) max(i) over (order by i) is null max(i) over (order by i) is not null
+NULL 1 0
+1 0 1
+2 0 1
+drop table t1;
+#
# Start of 10.3 tests
#
#