elcodi / bamboo

Meet Bamboo, an e-commerce project built on top of Elcodi and Symfony. Give us a star to support our project :)
http://bamboo.elcodi.com
MIT License
198 stars 44 forks source link

MySQL 5.7 incompatibility ONLY_FULL_GROUP_BY #684

Open ValentinMerlet opened 8 years ago

ValentinMerlet commented 8 years ago

MySQL 5.7.5 came with ONLY_FULL_GROUP_BY SQL Mode which seems to implose my little bamboo :sob:

See below : SQLSTATE[42000]: Syntax error or access violation: 1055 Expression # 46 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'bamboo.i7_.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by The only workaround I've found for now was to remove globally the ONLY_FULL_GROUP_BY SQL Mode :

mysql -uroot

SET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

But, changing sql_modes globally seems to be ugly, any ideas on how to fix it without needing to downgrade MySQL ?

To reproduce the issue, just access the HP after creating a new project.

mmoreram commented 8 years ago

@ValentinMerlet oups...

This error is not related to Elcodi itself but to Doctrine. Elcodi is built on top of Doctrine, so we should check how this new MySQL version breaks Doctrine.