[MDEV-27098] Subquery using the ALL keyword on TIME columns produces a wrong result Created: 2021-11-20 Updated: 2021-12-11 Resolved: 2021-11-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types, Temporal Types |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.2.42, 10.3.33, 10.4.23, 10.5.14, 10.6.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
This bug related to I create a table:
Now I run this query:
The result is wrong. It should return only one row the maxumum value, which is '120:00:00'. The same problem happens with this query:
It should return only one row with the minumum value, which is '-220:00:00'. The problem happens because select_max_min_finder_subselect::cmp_str() is executed at some point during these queries. It compares values as strings, therefore:
The TIME data type needs its own implementation, e.g. select_max_min_finder_subselect::cmp_time(). |
| Comments |
| Comment by Alexander Barkov [ 2021-11-20 ] |
|
The same problem is repeatable with the INET6 data type: See |
| Comment by Alexander Barkov [ 2021-11-20 ] |
|
The same problem is repeatable with the UUID data type: see |