Open hxsllc opened 2 years ago
Details:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dcashion_os2.value.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /home/dcashion/metascripta.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112 Stack trace:
Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dcashion_os2.value.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /home/dcashion/metascripta.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18 Stack trace:
Next Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT LOWER(MIN(value.value)) AS "identifier", MIN(value.resource_id) AS "id" FROM value value LEFT JOIN resource resource ON value.resource_id = resource.id WHERE (value.type = "literal") AND (value.property_id = ?) AND (resource.resource_type = ?) AND (value.value = ?) GROUP BY "identifier" ORDER BY "id" ASC, value.id ASC' with params [10, "Omeka\Entity\Item", "vtl_02619_01"]:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dcashion_os2.value.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /home/dcashion/metascripta.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128 Stack trace:
I'm hitting a similar error as @hxsllc when working with CleanUrl in combination with ARK identifiers in the dcterms:identifier
field.
My error:
Doctrine\DBAL\Exception\DriverException
An exception occurred while executing 'SELECT value.value, MIN(value.resource_id), resource.resource_type, value.id FROM value value INNER JOIN resource resource ON resource.id = value.resource_id WHERE (value.property_id = 10) AND (value.type = "literal") AND (value.value = ?) GROUP BY value.resource_id, resource.resource_type ORDER BY value.resource_id ASC, value.id ASC LIMIT 1' with params ["ark:\/99999\/b1pzAho"]: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'OmekaTest.value.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Omeka version: 3.2.0 CleanUrl version: 3.17.4.4
Skip "s/site-slug/" for default site
and press Submit
Skip "s/site-slug/" for default site
and press Submit
It seems like a bug that needs fixing. I will have a look when I have some time, but any hint in the proper direction would be welcome @Daniel-KM
Omeka S encountered an error
Doctrine\DBAL\Exception\DriverException An exception occurred while executing 'SELECT LOWER(MIN(value.value)) AS "identifier", MIN(value.resource_id) AS "id" FROM value value LEFT JOIN resource resource ON value.resource_id = resource.id WHERE (value.type = "literal") AND (value.property_id = ?) AND (resource.resource_type = ?) AND (value.value = ?) GROUP BY "identifier" ORDER BY "id" ASC, value.id ASC' with params [10, "Omeka\Entity\Item", "vtl_02619_01"]: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dcashion_os2.value.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
From: https://stackoverflow.com/questions/41887460/select-list-is-not-in-group-by-clause-and-contains-nonaggregated-column-inc/41887524
There is a system variable "ONLY_FULL_GROUP_BY" in MySql engine. From Mysql Version 5.7.5 : ONLY_FULL_GROUP_BY SQL mode is enabled by default Before Version 5.7.5 : ONLY_FULL_GROUP_BY was not enabled by default.
If the ONLY_FULL_GROUP_BY SQL mode is enabled (which it is by default from version 5.7.5), MySQL rejects queries for which the select list, HAVING condition, or ORDER BY list refer to non-aggregated columns that are neither named in the GROUP BY clause nor are functionally dependent on them.