Incorrect query results and problems with FULL GROUP BY
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
I noticed that I was getting an invalid mapping of hostname_max and db_max after adding them to the query.
It appears that the GROUP BY is not properly grouping the data.
If I turn on FULL GROUP BY then I get an error message from MySQL.
```
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'slow_query_log.dimension.sample' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (1055)
```
Contributor guide
Research direction
Locate the query that adds hostname_max and db_max, then reproduce the invalid mapping with MySQL's FULL GROUP BY mode enabled. Review how the GROUP BY handles the nonaggregated dimension.sample column and verify that the results are valid without triggering error 1055.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100