summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_time.result9
-rw-r--r--mysql-test/t/type_time.test8
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index 59de00fa416..bdcffc8d824 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -1206,5 +1206,14 @@ Warning 1292 Incorrect time value: '9000000' for column 'b' at row 4
Warning 1292 Incorrect time value: '9000000' for column 'c' at row 4
DROP TABLE t1;
#
+# MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
+#
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:10:10'),('10:20:30');
+SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
+MAX(a) MAX(COALESCE(a))
+10:20:30 10:20:30
+DROP TABLE t1;
+#
# End of 10.1 tests
#
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index b257aa4f455..27679b9ec5a 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -716,5 +716,13 @@ SELECT a, TIME(a),TIME(b),TIME(c) FROM t1 ORDER BY a;
DROP TABLE t1;
--echo #
+--echo # MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
+--echo #
+CREATE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES ('10:10:10'),('10:20:30');
+SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.1 tests
--echo #