summaryrefslogtreecommitdiff
path: root/mysql-test/t/win.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-07-04 14:14:30 +0400
committerAlexander Barkov <bar@mariadb.org>2017-07-04 14:14:30 +0400
commit25ad623d64ebc34093544875e5b0ebd6101e975b (patch)
treeee4fb7047a003b0a8c292af0b91e3ef37b870477 /mysql-test/t/win.test
parent760127ac6ff428d4538733b3f99b743f7a802581 (diff)
downloadmariadb-git-25ad623d64ebc34093544875e5b0ebd6101e975b.tar.gz
MDEV-13240 Wrong warning with MAX(datetime_field) OVER (...)
The problem resided in Item_window_func implementation, and it was revealed by bb-10.2-ext specific changes: Item_window_func::save_in_field() works differently in bb-10.2-ext vs 10.2: - 10.2 goes through val_str() - bb-10.2-ext goes through get_date(), due to Type_handler related changes. get_date() tries to convert empty string to DATETIME, hence the warning. During a discussion with Vicentiu, it was decided to fix Item_window_func::val_xxx() to return NULL (instead of an "empty" value, such as 0 for numbers and '' for strings) when force_return_blank is set.
Diffstat (limited to 'mysql-test/t/win.test')
-rw-r--r--mysql-test/t/win.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test
index 95d32c5bd14..dfcf00cabf9 100644
--- a/mysql-test/t/win.test
+++ b/mysql-test/t/win.test
@@ -1877,3 +1877,16 @@ select count(max(id)) over (order by max(id)) from t1 where id < 3;
select max(id), rank() over (order by max(id)) from t1 where id < 3;
drop table t1;
+
+--echo #
+--echo # Start of 10.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-13240 Wrong warning with MAX(datetime_field) OVER (...)
+--echo #
+
+CREATE TABLE t1 (dt DATETIME);
+INSERT INTO t1 VALUES ('2017-05-17');
+SELECT MAX(dt) OVER (ORDER BY dt ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) FROM t1;
+DROP TABLE t1;