mirror of
https://github.com/django/django.git
synced 2025-09-23 10:42:45 +00:00
Fixed #23061: Avoided setting a limit on a query for get with select_for_update on Oracle
Thanks Michael Miller for reporting the issue.
This commit is contained in:
parent
6d256ae248
commit
746f2a4bed
4 changed files with 14 additions and 1 deletions
|
@ -357,7 +357,9 @@ class QuerySet(object):
|
|||
clone = self.filter(*args, **kwargs)
|
||||
if self.query.can_filter():
|
||||
clone = clone.order_by()
|
||||
clone = clone[:MAX_GET_RESULTS + 1]
|
||||
if (not clone.query.select_for_update or
|
||||
connections[self.db].features.supports_select_for_update_with_limit):
|
||||
clone = clone[:MAX_GET_RESULTS + 1]
|
||||
num = len(clone)
|
||||
if num == 1:
|
||||
return clone._result_cache[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue