[MDEV-8863] Wrong result for MAX(COALESCE(time_column)) Created: 2015-09-28  Updated: 2015-09-28  Resolved: 2015-09-28

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.1.8

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: upstream-not-affected

Issue Links:
Relates
relates to MDEV-8862 Wrong field type for MAX(COALESCE(dat... Closed
Sprint: 10.1.8-3

 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIME);
INSERT INTO t1 VALUES ('10:20:30'),('10:20:30');
SELECT MAX(a), MAX(COALESCE(a)) FROM t1;

returns

+----------+------------------+
| MAX(a)   | MAX(COALESCE(a)) |
+----------+------------------+
| 10:20:30 | 7594:20:30       |
+----------+------------------+

The expected result is to return 10:20:30 for both columns.


Generated at Thu Feb 08 07:30:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.