-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
ActiveQuery::one() limiting database records #58 #20266
base: master
Are you sure you want to change the base?
Conversation
uaoleg
commented
Oct 8, 2024
•
edited
Loading
edited
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ❌ |
Breaks BC? | ❌ |
Fixed issues | #58 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20266 +/- ##
============================================
- Coverage 64.95% 63.76% -1.19%
Complexity 11396 11396
============================================
Files 430 430
Lines 36925 36925
============================================
- Hits 23984 23545 -439
- Misses 12941 13380 +439 ☔ View full report in Codecov by Sentry. |
The tests fail, what problem are we solving here? |
@terabytesoftw failures are not related to the change. Solving the following issue: yiisoft/active-record#58 |
I don't think that adding implicit limit to |
@rob006 is there any benchmarks proving |
@uaoleg I'm not sure if there are recent examples, but note mentioned in yiisoft/active-record#58 (comment) still exists in MySQL documentation, so this is not only about performance - such change could affect behavior in some cases. |
@rob006 looks like the ORDER-LIMIT "feature" should not affect the first row =) |
I think this need to be closed. It solves the issue that wasn't the issue with referred ticket #58. |
@mtangoo I still believe it's rediculous to add |
You see, that is not the problem. That ticket was about something else, hence this is not the solution given the circumstance. If you want to discuss that, then you should open discussion under 2.2, since I doubt that behavior will change for 2.0.x Since you were solving wrong issue, I think I can close this. |
I'd expect LIMIT 1 to be added if not all the edge cases mentioned by @rob006...
Well, replace "category" with "rating" and it will make perfect sense to select the top item based on rating. |