feat: Always add LIMIT 1 to findOne queries - #14549
Conversation
|
I agree, not adding Strangely enough, some mssql tests are failing with this change. This is the only comment I could find that mentioned this behavior as intended #4416 (comment) |
|
@ephys thanks for looking a this. I reran the mssql tests locally on |
|
@ephys , sorry to say I have been able to identify a commit where these tests started failing. I'm wondering if that has come up in other PRs? To Reiterate, the MSSQL tests fail locally for me on |
|
are you using |
ac96380 to
fcbea07
Compare
|
@ephys, I'm trying to make sure I'm properly running the test locally. Thanks for your patience. |
fcbea07 to
a730339
Compare
fe5747a to
c7f106a
Compare
|
I found the reason why LIMIT was not included #9248. I'm documenting it here for future PRs but I disagree with the premise of that PR and I agree LIMIT should be specified. Edit: Changed the commit type to |
findOne queriesfindOne queries
52725df to
4e36dec
Compare
|
I'll run the tests again after GitHub solves the caching outage https://www.githubstatus.com/incidents/6r4sms3hcj3x |
|
🎉 This PR is included in version 7.0.0-alpha.14 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
Hello, I have my doubts that this is correct. Are we sure that |
* fix: always add LIMIT 1 to `findOne` queries * fix: add temp patch for issue 14618 Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>

Pull Request Checklist
Please make sure to review and check all of these items:
yarn testoryarn test-DIALECTpass with this change (including linting)?Description Of Change
Remove conditional logic for adding
LIMIT 1tofindOnequeries. Instead, always add it.LIMIT 1benefits any query that should return a single result.findOnelogic for addinglimit: 1led to severe performance degredation. #14548