Open adam-buckley opened 8 years ago
could you please explain how a query needs to be adjusted to work with this?
In principle I think we shouldn't let our codebase be beholden by default settings of ONE operating system or Linux distribution. Maybe MySQL has a different setting when installed on CentOS or CloudOS or Debian or Redhat or SuSE ....
Is this a database setting that can be checked from within the installer maybe and then print an alert?
It's not the cause of any operating system...
From the MySQL 5.7 reference:
The default SQL mode in MySQL 5.7 includes these modes: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, and NO_ENGINE_SUBSTITUTION. The ONLY_FULL_GROUP_BY and STRICT_TRANS_TABLES modes were added in MySQL 5.7.5.
Version 5.7.5 was released in late 2014 so maybe we haven't noticed this issue because we seem to use older versions of MySQL, the default installed in Ubuntu 14.04 is 5.5 or 5.6.
What the only_full_group_by flag does:
Reject queries for which the select list, HAVING condition, or ORDER BY list refer to nonaggregated columns that are neither named in the GROUP BY clause nor are functionally dependent on (uniquely determined by) GROUP BY columns.
It's hard to explain the fixes for our queries, but here is the MySQL article on using group by in 5.7
By default, the SQL_MODE flag is set to "only_full_group_by". We should adjust our queries to work with this flag