Skip to content

Fix: SQLSTATE[42000]: Syntax error or access violation#5

Closed
mn-martin wants to merge 1 commit intoteppokoivula:masterfrom
mn-martin:patch-1
Closed

Fix: SQLSTATE[42000]: Syntax error or access violation#5
mn-martin wants to merge 1 commit intoteppokoivula:masterfrom
mn-martin:patch-1

Conversation

@mn-martin
Copy link
Copy Markdown

Your Selector is not compatible with: sql_mode=only_full_group_by

Errors:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'objektdatenbank.d.property' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /site/modules/VersionControl/ProcessVersionControl.module line 249)

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #8 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'objektdatenbank.d.data' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /site/modules/VersionControl/ProcessVersionControl.module line 248)

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'objektdatenbank.d.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /site/modules/VersionControl/ProcessVersionControl.module line 249)

Your Selector is not compatible with: sql_mode=only_full_group_by

Errors:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression teppokoivula#7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'objektdatenbank.d.property' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /site/modules/VersionControl/ProcessVersionControl.module line 249)

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression teppokoivula#8 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'objektdatenbank.d.data' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /site/modules/VersionControl/ProcessVersionControl.module line 248)

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression teppokoivula#2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'objektdatenbank.d.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /site/modules/VersionControl/ProcessVersionControl.module line 249)
@teppokoivula
Copy link
Copy Markdown
Owner

Thanks, @mn-martin, and sorry for taking so long to respond!

For the record, I ended up solving this in a more "verbose" way. Probably since my test environment is running on a relatively old version of MySQL, even with your changes I still got a bunch of errors as soon as I enabled ONLY_FULL_GROUP_BY.

Unless I'm missing something here, the original query was already "standard SQL", but MySQL doesn't properly recognise functional dependencies with GROUP BY. 5.7.5 introduced notable improvements to this part, but it seems to me that some cases still might not work perfectly.

If you get a chance to test the latest version of the module, please let me know if it fixes this problem for you. Thanks again for bringing this to my attention!

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

Successfully merging this pull request may close these issues.

2 participants