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

Clear sql_mode settingss ONLY_FULL_GROUP_BY and STRICT_TRANS_TABLES for MySQL < 5.7 #44

Open
BitPoet opened this issue Oct 28, 2016 · 1 comment

Comments

@BitPoet
Copy link

BitPoet commented Oct 28, 2016

Short description of the enhancement

The fix for processwire/processwire-issues#28 makes PW automatically remove the ONLY_FULL_GROUP_BY and STRICT_TRANS_TABLES sql_mode settings when a new db connection is initiated. It would make sense to also do this for lower versions (MySQL 5.5, 5.6).

Current vs. suggested behavior

Currently, the "remove" option in $config->dbSqlModes for these properties defines the minimum applicable MySQL version as 5.7.0.

It would IMHO make sense to change the version number there to from 5.7.0 to 5.5.0.

Why would the enhancement be useful to users?

Both settings are already available in MySQL 5.5, and a good number of hosting providers now enable them by default, as e.g. seen in this forum discussion.

@adrianbj
Copy link

adrianbj commented Mar 7, 2017

@BitPoet - I agree that if this setting is being changed, then it should be changed on all versions of MYSQL.

Maybe not the best place to discuss this, but I am wondering if it would actually be better to rewrite GROUP BYs or make the SELECTed columns aggregated so PW doesn't need ONLY_FULL_GROUP_BY disabled. I just did some reading on this: http://rpbouman.blogspot.ca/2007/05/debunking-group-by-myths.html which actually suggests that perhaps it is actually fine to use partial group by clauses, although I do know from my own experience that partial group bys can bite you if you're not careful, but I am sure @ryancramerdesign has been aware of this along the way and checked for any issues.

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

2 participants