[MDEV-27473] Inconsistent results upon subquery with aggregate function and implicit cast Created: 2022-01-12 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The first query, without ORDER BY, returns one row:
The second query, with ORDER BY DESC, returns two rows:
And the third query, which is the same as the first one but after an index was dropped, returns 3 rows:
Because of an aggregate function upon an empty result set in subquery and a datatype difference (time vs int), I wouldn't dare claim which of the results is correct. But they can't all be correct at once. |