Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when duplicate product - MySQL 5.7 #1992

Closed
rflx opened this issue Oct 26, 2018 · 2 comments
Closed

Error when duplicate product - MySQL 5.7 #1992

rflx opened this issue Oct 26, 2018 · 2 comments
Labels
Milestone

Comments

@rflx
Copy link

rflx commented Oct 26, 2018

When I try to copy (duplicate) a product it generates following error:

An exception occurred while executing 'SELECT c1.*, MAX(c2.sorting) AS max_sorting FROM tl_iso_product_category c1 LEFT JOIN tl_iso_product_category c2 ON c1.page_id=c2.page_id WHERE c1.pid=17 GROUP BY c1.page_id': SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cto_inlain.c1.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Edit: this error happens also when i try to open the Integrity Check.

Isotope 2.5.8
Contao 4.6.6
MySQL 5.7.23

@rflx
Copy link
Author

rflx commented Oct 26, 2018

I've found out that this is an MySQL 5.7 issue.
Due that MySQL 5.7 is now defaulted to ONLY_FULL_GROUP_BY turned on (https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_only_full_group_by). Which means its a two-step group and MySQL needs to know which group should be shown first.

Workaround: if you are using MySQL 5.7 you could try to turn off ONLY_FULL_GROUP_BY in your mysql.cnf config by removing it in sql_mode:

mysql.cnf:

[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

@rflx rflx changed the title Error when duplicate product Error when duplicate product - MySQL 5.7 Oct 26, 2018
@aschempp aschempp added the bug label Jan 8, 2019
@aschempp aschempp added this to the 2.5.10 milestone Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants