mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column))
This commit is contained in:
@@ -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
|
||||
#
|
||||
|
||||
@@ -715,6 +715,14 @@ INSERT INTO t1 VALUES (9000000,9000000,9000000);
|
||||
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 #
|
||||
|
||||
@@ -1089,7 +1089,9 @@ bool Item_func_hybrid_result_type::get_date(MYSQL_TIME *ltime,
|
||||
case STRING_RESULT:
|
||||
{
|
||||
if (is_temporal_type(field_type()))
|
||||
return date_op(ltime, fuzzydate);
|
||||
return date_op(ltime,
|
||||
fuzzydate |
|
||||
(field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0));
|
||||
char buff[40];
|
||||
String tmp(buff,sizeof(buff), &my_charset_bin),*res;
|
||||
if (!(res= str_op(&tmp)) ||
|
||||
|
||||
Reference in New Issue
Block a user