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

fixed #5622 - mysql 5.7 ONLY_FULL_GROUP_BY #6143

Merged
merged 5 commits into from
Jul 22, 2017

Conversation

chihiro-adachi
Copy link

#5622

I fixed it with reference to #5973
please check.

@ruudk
Copy link
Contributor

ruudk commented Dec 8, 2016

I just tested this in our project and it seems to solve the issues. Really awesome! 👍

Would be great if this could get merged.

@kissifrot
Copy link

Confirmed here too, +1 for a merge :)

@zluiten
Copy link
Contributor

zluiten commented Feb 27, 2017

Looks good. Let's merge this!

@chihiro-adachi
Copy link
Author

@Ocramius
this pr Is there something wrong?
anything else needed?

thank you.

@Ocramius
Copy link
Member

Ocramius commented Mar 15, 2017 via email

@mauriciogtaborda
Copy link

lgtm 👍

@nateevans
Copy link

is this on deck to be pulled in anytime soon?

@fefas
Copy link

fefas commented May 9, 2017

+1

1 similar comment
@paaacman
Copy link

+1

paaacman added a commit to paaacman/doctrine2 that referenced this pull request May 19, 2017
copy 
fixed doctrine#5622 - mysql 5.7 ONLY_FULL_GROUP_BY doctrine#6143
chihiro-adachi  wants to merge 2 commits into doctrine:master from chihiro-adachi:patch-1
paaacman added a commit to paaacman/doctrine2 that referenced this pull request May 19, 2017
copy
fixed doctrine#5622 - mysql 5.7 ONLY_FULL_GROUP_BY doctrine#6143
chihiro-adachi  wants to merge 2 commits into doctrine:master from chihiro-adachi:patch-1
@Einenlum
Copy link
Contributor

+1

@lcobucci
Copy link
Member

lcobucci commented Jul 3, 2017

@Ocramius I've synced this PR with master and added MySQL 5.7 to Travis. I'm just not fully convinced that this is the way to go (regex stuff and also the impact of wrapping the subquery on the other platforms).

@teohhanhui
Copy link
Contributor

the impact of wrapping the subquery on the other platforms

Any SQL-compliant platform should require this fix.

@Arkemlar
Copy link

why still not merge?

@Ocramius
Copy link
Member

@Arkemlar because I'd rather not have support for MySQL 5.7 than having security issues due to regex-based SQL manipulation.

The patch may be good, but it will need further checking for edge-cases in the newly added conditionals.

Also, tests were only modified so far, but none was added.

wucdbm and others added 5 commits July 22, 2017 19:28
Should fix MySQL 5.7 issues caused by ONLY_FULL_GROUP_BY
Also simplifying the REGEX to remove the ORDER BY type (ASC/DESC) with a
substr() since OrderByItem#type is always defined.
@Ocramius
Copy link
Member

Looking good according to @lcobucci's changes: will likely merge today.

@Ocramius Ocramius self-assigned this Jul 22, 2017
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM 👍 🚢

@Ocramius Ocramius merged commit 2fb3cfd into doctrine:master Jul 22, 2017
@lcobucci lcobucci moved this from Review to Done in ORM v2.6.x Jul 23, 2017
@chihiro-adachi chihiro-adachi deleted the patch-1 branch July 24, 2017 01:08
@teohhanhui
Copy link
Contributor

Will this be merged into stable versions as a bugfix?

@Ocramius
Copy link
Member

@chihiro-adachi this is already in 2.6.0

@teohhanhui
Copy link
Contributor

Is 2.6.0 released yet? I can't find it anywhere. But I mean this should be treated as a bug, right? If so, might it be fixed in the currently supported versions?

@lcobucci
Copy link
Member

lcobucci commented Jul 24, 2017 via email

@Ocramius
Copy link
Member

@teohhanhui no, newer mysql versions broke BC and we simply support them in a newer version only.

@teohhanhui
Copy link
Contributor

I thought this bug is also present when using other SQL-compliant platforms such as PostgreSQL... Because this bug only manifested itself when MySQL started becoming more SQL-compliant.

@Ocramius
Copy link
Member

@teohhanhui yes, but only MySQL crashes hard. So far, the only issue with such queries was non-deterministic result due to ordering.

@ureimers
Copy link
Contributor

@teohhanhui If you can't wait for Doctrine 2.6 to be released you still have the hackish way of overriding the Autoloader in your composer.json:

"autoload": {
        [...]
        "files": ["src/LimitSubqueryOutputWalkerPatch.php"]
    },

Just put the fixed source from this PR into the LimitSubqueryOutputWalkerPatch.php. When composer dumps your autoloader the class will take precedence over the Doctrine 2.5 one. Until Doctrine 2.6 is available you use this to temporarily fix the MySQL 5.7 incompatibility of the Paginator.

But keep in mind that this is pretty hackish. On the other hand if a project is blocked because of this you sometimes just don't have a choice.

@InfopactMLoos
Copy link

Is this not backported to 2.5 ? Since my company uses Ubuntu 16.04 LTS and the 2.6 branch does not support PHP 7.0 I cannot upgrade to 2.6. @ureimers solution works but I would prefer a cleaner solution if possible. I tried using the patch generated by this pull request but it is not compatible with 2.5. Now trying to strip down this patch so the changes can be applied to 2.5 but was wondering why this bugfix is 2.6 only.

@Ocramius
Copy link
Member

@InfopactMLoos no, you will need to upgrade to 2.6. Upgrading PHP version is easy peasy via http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/

why this bugfix is 2.6 only.

MySQL 5.7 support is an addition.

@InfopactMLoos
Copy link

Yeah I know how to do that through ppa it's easy indeed but company policy is to keep everything LTS compatible. We try to minimize customizations to base server images. Ok no worries I just completed rolling the patch and it seems to work fine. Was just wondering why, anyway thanks for the quick response!

@shkkmo
Copy link

shkkmo commented Jun 17, 2018

It seems like there should be a version of Doctrine that supports both PHP 7.0 and MySQL given that those are the available versions in Ubuntu 16.04

@Ocramius
Copy link
Member

Won't happen, as that is just pushing back the ecosystem with the excuse that the ecosystem is already being pushed back.

You can simply rely on the PPAs by ondrej, which reflect PHP core development, on which you can rely for security maintenance as well.

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

Successfully merging this pull request may close these issues.

None yet