[MDEV-10817] CAST(MAX(DATE'2001-01-01') AS TIME) returns a wrong result Created: 2016-09-16 Updated: 2017-11-08 Resolved: 2017-11-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Affects Version/s: | 10.0, 10.1, 10.2 |
| Fix Version/s: | 10.2.11, 10.3.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.2.11 |
| Description |
|
CAST from DATE to TIME usually returns zero time 00:00:00:
However, in some cases it works differently:
The problem happens because Item_sum_max does not implement its own get_date() method, so execution goes through the generic Item::get_date() which calls val_str() followed by string-to-time conversion. |
| Comments |
| Comment by Alexander Barkov [ 2016-09-16 ] | |||
|
Also repeatable in this scenario:
|