Fixed #26500 -- Added SKIP LOCKED support to select_for_update().

Thanks Tim for the review.
This commit is contained in:
Simon Charette 2016-06-23 11:52:14 -04:00
parent 46509cf13d
commit b8e6e1b43b
No known key found for this signature in database
GPG key ID: 72AF89A0B1B4EDB3
11 changed files with 98 additions and 27 deletions

View file

@ -167,6 +167,7 @@ class Query(object):
self.distinct_fields = []
self.select_for_update = False
self.select_for_update_nowait = False
self.select_for_update_skip_locked = False
self.select_related = False
# Arbitrary limit for select_related to prevents infinite recursion.
@ -286,6 +287,7 @@ class Query(object):
obj.distinct_fields = self.distinct_fields[:]
obj.select_for_update = self.select_for_update
obj.select_for_update_nowait = self.select_for_update_nowait
obj.select_for_update_skip_locked = self.select_for_update_skip_locked
obj.select_related = self.select_related
obj.values_select = self.values_select[:]
obj._annotations = self._annotations.copy() if self._annotations is not None else None