[MDEV-10122] MariaDB does not support group functions in some contexts where MySQL does Created: 2016-05-25 Updated: 2017-02-14 Resolved: 2017-02-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Alexander Barkov | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-rc | ||
| Issue Links: |
|
||||||||
| Description |
|
I create a table like this:
These queries normally return results:
These queries return the "Invalid use of group function" error:
In MySQL-5.7 all above queries work without errors. The same problem is repeatable with MAX instead of GROUP_CONCAT:
These queries fail in MariaDB, but work in MySQL:
|
| Comments |
| Comment by Elena Stepanova [ 2016-05-27 ] |
|
It worked in 5.1 and 5.2, but stopped working in 5.3. |
| Comment by Oleksandr Byelkin [ 2017-01-24 ] |
|
I think it is connected to nonsens of having ORDER BY in subquery without LIMIT clause. |
| Comment by Alexander Barkov [ 2017-01-24 ] |
|
Right, some ORDER BY are redundant. Perhaps, instead of returning an error, the optimizer could remove the redundant ORDER BY. |
| Comment by Sergei Petrunia [ 2017-02-09 ] |
|
Ok to push. |
| Comment by Vicențiu Ciorbaru [ 2017-02-14 ] |
|
Fixed with https://github.com/mariadb/server/commit/f675eab7dc7f1eb4f4b61bfdd548d9e8052678a4 |