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

Fehler: Große Tagsanzahl verursacht Fehler #42

Open
jankout opened this issue May 30, 2018 · 2 comments
Open

Fehler: Große Tagsanzahl verursacht Fehler #42

jankout opened this issue May 30, 2018 · 2 comments

Comments

@jankout
Copy link

jankout commented May 30, 2018

Hallo Helmut,

mir scheint es, dass zu viele Tags in der Tabelle folgenden Fehler verursachen, sodass die Newsdetailseite nicht gezeigt wird. Oder muss ich etwas im News-full-Template anpassen?

Wenn ich die Tags bei den Newsbeiträgen rausnehme, geht es wieder.

Schon jetzt danke ich dir für deinen Ratschlag.

cadus-org-tags

[2018-05-30 18:07:32] app.CRITICAL: An exception occurred. {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing 'SELECT * FROM\n\t\t\t(\n \n\t\t\t\t(\n\t\t\t\t\tSELECT n.*, count(t.id) AS count_tags, 1 AS type \n\t\t\t\t\tFROM tl_news n\n\t\t\t\t\tLEFT JOIN tl_tag t\n\t\t\t\t\t\tON n.id = t.tid\n\t\t\t\t\t\n\t\t\t\t\tWHERE n.pid IN(4,5)\n\t\t\t\t\t\tAND (t.tag IN('AERU','Airborne','Cadus','Emergency Response'))\n\t\t\t\t\t\t\n\t\t\t\t\t\tAND n.id!='450'\n\t\t\t\t\t\t\tAND (n.start = '' OR n.start < '1527696452') AND (n.stop = '' OR n.stop > '1527696452') AND n.published = 1\n\t\t\t\t\tGROUP BY n.id\n\t\t\t\t\tORDER BY count_tags DESC, n.date DESC\n\t\t\t\t\tLIMIT 0\n\t\t\t\t)\n\t\t\t\t\n \n \n \n\t\t\t\tUNION\n\t\t\t\t\n \n\t\t\t\t(\n\t\t\t\t\tSELECT n.*, 0 AS count_tags, 3 AS type \n\t\t\t\t\tFROM tl_news n\n\t\t\t\t\t\n\t\t\t\t\tWHERE n.pid='4'\n\t \n\t\t\t\t\t\tAND n.id!='450'\n\t\t\t\t\t\t AND (n.start = '' OR n.start < '1527696452') AND (n.stop = '' OR n.stop > '1527696452') AND n.published = 1\n\t\t\t\t\tORDER BY n.date DESC\n\t\t\t\t\tLIMIT 0\n\t\t\t\t)\n\t\t\t\t\n\t\t\t)\n\t\t\tAS n\n\t\t\tGROUP BY n.id\n\t\t\tORDER BY n.type ASC,n.count_tags DESC,n.date DESC\n\t\t\tLIMIT 0':\n\nSQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'n.pid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by at /var/www/cadus.org/contao4/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:125, Doctrine\\DBAL\\Driver\\PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'n.pid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by at /var/www/cadus.org/contao4/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:109, PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'n.pid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by at /var/www/cadus.org/contao4/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:107)"} []

@hschottm
Copy link
Owner

Also der Fehler kommt, weil die SQL-Abfrage falsch ist. Die Frage ist, woher kommt diese Abfrage? Von mir stammt die nicht, so komplexe Abfragen habe ich nicht im tags-Modul. Ich habe keine Idee, woher diese Abfrage kommen könnte.
Welches Modul führt denn dazu, dass der Fehler auftritt?

@Sioweb
Copy link
Contributor

Sioweb commented Sep 1, 2020

Tag zusammen,

der Fehler hängt mit der Mysql-Version zusammen und nicht zwangsläufig mit dem Modul: sql_mode=only_full_group_by.

Die Meldung kann mit einem SQL-Query entfernt werden:

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants