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

Correct hydration of resultsets coming from DQL queries where the root of the selection is aliased and also the root of an inheritance #6367

Merged
merged 1 commit into from
May 2, 2017

Conversation

SirWaddles
Copy link
Contributor

Resolves Issue #6362

Added a test case for reproducability.

@SirWaddles
Copy link
Contributor Author

The main reason for test is to check that the Undefined Property error does not occur, and if you run the test without the fix, it will error out. It does however also make some assertions about the format of the result which may be questionable.

The resultset only has one row, yet the hydrated result has two. My assumption was that this is intentional as this change did not break any tests, but it does seem odd to me.

@SirWaddles
Copy link
Contributor Author

Might be worth running the tests again, only one job failed and it had just stalled before even getting to my code. I have no idea why my change would cause only PHP7.1/MariaDB to halt.

@Ocramius
Copy link
Member

Ocramius commented Apr 4, 2017

@SirWaddles restarted

Copy link
Member

@lcobucci lcobucci left a comment

Choose a reason for hiding this comment

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

The rest LGTM, what do you think @Ocramius?

}

/**
* SELECT a as base, b, c, d
Copy link
Member

Choose a reason for hiding this comment

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

@group GH6362 missing

@lcobucci
Copy link
Member

lcobucci commented May 1, 2017

@SirWaddles I've rebased your branch to sync with the latest updates and group the commits. Patch LGTM but I'd love to have @guilhermeblanco's and/or @Ocramius' opinion just to double check.

Thanks for the contribution 😉

@lcobucci
Copy link
Member

lcobucci commented May 1, 2017

Quite easy to backport for v2.5.7 too...

@Ocramius
Copy link
Member

Ocramius commented May 2, 2017

Good to go! Will also backport 👍

Thanks @SirWaddles, pristine work.

@Ocramius Ocramius merged commit 77ee69f into doctrine:master May 2, 2017
@Ocramius Ocramius changed the title Fix inheritance alias Fix inheritance query hydration when one selection is aliased May 2, 2017
@Ocramius
Copy link
Member

Ocramius commented May 2, 2017

Hah, I backported to 2.5 via 04fc7a9, but it will obviously fail due to lack of PHP 5.4 compliance =_=

@Ocramius
Copy link
Member

Ocramius commented May 2, 2017

Should be corrected in d2c805b (see https://travis-ci.org/doctrine/doctrine2/builds/227851219)

@Ocramius Ocramius changed the title Fix inheritance query hydration when one selection is aliased Correct hydration of resultsets coming from DQL queries where the root of the selection is aliased and also the root of an inheritance Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants