[MDEV-12922] Expressions should be properly supported in GROUP BY in ONLY_FULL_GROUP_BY sql_mode Created: 2017-05-26 Updated: 2018-11-26 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Parser |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Valerii Kravchuk | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | upstream | ||
| Description |
|
As MySQL (and MariaDB) support expressions in GROUP BY clause (see https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html), it would be useful to support them in ONLY_FULL_GROUP_BY mode as well (taking the mode details into account). Now (in 10.2) it seems even obviously logically correct queries are rejected, while in even more trivial cases expressions in GROUP BY work. Consider the following example:
So, either we should reject all kinds of expressions in GROUP_BY when we use ONLY_FULL_GROUP_BY mode, or we should take functional dependencies on these expressions into account properly. This is probably related to https://jira.mariadb.org/browse/MDEV-11588 See also upstream https://bugs.mysql.com/bug.php?id=86475 |