odiseoteam / SyliusReportPlugin

Report Plugin for Sylius. This plugin add a report interface to the Sylius administration. Some reports comes with this bundle but you can create your custom reports.
MIT License
31 stars 10 forks source link

Mysql 'full_group_by' mode not compatible #10

Closed vasilvestre closed 2 years ago

vasilvestre commented 5 years ago

For query

SELECT DATE(s0_.created_at) AS sclr_0, count(s0_.id) AS sclr_1, MONTH(s0_.created_at) AS sclr_2, YEAR(s0_.created_at) AS sclr_3 FROM sylius_order s0_ WHERE s0_.created_at >= ? AND s0_.created_at <= ? GROUP BY sclr_2, sclr_3 ORDER BY sclr_0 ASC, sclr_2 ASC, sclr_3 ASC' with params ["1919-09-03 00:00:00", "2019-09-03 23:59:59"

The error

Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'gifts.s0_.created_at' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by").
songecko commented 5 years ago

Hi @vasilvestre . You need to change the sql_mode. We need that configuration in order to make complex queries. For the near future we have the plan to use Elastic search instead of SQL to make the report queries.

vasilvestre commented 4 years ago

I hoped something else could have been done as the mode can reduce performance :/

bigboss86 commented 2 years ago

Solved!