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

Update SQL to fix incompatibility with sqlmode OnlyFullGroupBy #10079

Conversation

haynescd
Copy link
Collaborator

@haynescd haynescd commented Mar 13, 2023

Fix #10080

After MySQL 5.7.5 ONLY_FULL_GROUP_BY mode was added, which rejects queries which select list refer to non-aggregated columns that are neither named in the group by clause.

https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_only_full_group_by

Describe changes proposed in this pull request:
Updated Query to utilize ANY_VALUE()
https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value

MySQL vs H2 compatibility

Integration tests run agains a H2 in-memory database that does not support the ANY_VALUE statement. To solve this, knowledge of the database type is passed to MyBatis using the MyBatis DatabaseIdProvider mechanism that will use ANY_VALUE statements only when MySQL database is used.

Copy link
Member

@dippindots dippindots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@pvannierop pvannierop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this! I added the following comment on the PR description to document the change:

MySQL vs H2 compatibility

Integration tests run agains a H2 in-memory database that does not support the ANY_VALUE statement. To solve this, knowledge of the database type is passed to MyBatis using the MyBatis DatabaseIdProvider mechanism that will use ANY_VALUE statements only when MySQL database is used.

…d support for multiple database impls to support mysql and h2
@haynescd haynescd force-pushed the bugfix/ch/Fix-incompatible-with-sqlmodeOnlyFullGroupBy branch from 8669d99 to 30578f4 Compare March 15, 2023 18:19
@sonarcloud
Copy link

sonarcloud bot commented Mar 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@haynescd haynescd merged commit f375e62 into cBioPortal:master Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG SQL Query incompatibility with sqlmode OnlyFullGroupBy Local e2e test failing
5 participants