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 selectOption position in build select query #17432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kikimor
Copy link

@kikimor kikimor commented Jul 15, 2019

Q A
Is bugfix? ✔️
New feature?
Breaks BC? ❌, but may be for some users
Tests pass? ✔️

The existing implementation of select queries building has got a flaw. If you are using the distinct() the query may be built incorrectly. For example for Oracle it does not allow to use database hints together with a distinct(), because order are matter.

Query:
Table::find()->distinct()->select(['t.COLUMN'], '/*+INDEX ("t" I_UK)*/')
built as:
SELECT DISTINCT /*+INDEX ("t" I_UK)*/ "t"."COLUMN" FROM "SCHEMA"."TABLE"

After changes built this query as:
SELECT /*+INDEX ("t" I_UK)*/ DISTINCT "t"."COLUMN" FROM "SCHEMA"."TABLE"

@samdark samdark added this to the 2.0.23 milestone Jul 15, 2019
@samdark samdark added status:to be verified Needs to be reproduced and validated. pr:request for unit tests Unit tests are needed. labels Jul 15, 2019
@samdark samdark removed this from the 2.0.23 milestone Jul 16, 2019
@yii-bot
Copy link

yii-bot commented Jul 16, 2019

Thank you for putting effort in the improvement of the Yii framework.
We have reviewed your pull request.

In order for the framework and your solution to remain stable in the future, we have a unit test requirement in place. Therefore we can only accept your pull request if it is covered by unit tests.

Could you add these please?

Thanks!

P.S. If you have any questions about the creation of unit tests? Don't hesitate to ask for support. More information about unit tests

This is an automated comment, triggered by adding the label pr:request for unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted pr:request for unit tests Unit tests are needed. status:to be verified Needs to be reproduced and validated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants