mirror of
https://github.com/django/django.git
synced 2025-07-12 05:39:11 +00:00
[2.2.x] Fixed #30904 -- Doc'd caveat about using filtered queryset with select_for_update() on MySQL.
Backport of fc2b1cc926e34041953738e58fa6ad3053059b22 from master
This commit is contained in:
parent
9d627bf9b2
commit
fb77d53ffe
@ -617,6 +617,11 @@ the ``SELECT ... FOR UPDATE`` statement. If ``select_for_update()`` is used
|
|||||||
with ``nowait=True``, ``skip_locked=True``, or ``of`` then a
|
with ``nowait=True``, ``skip_locked=True``, or ``of`` then a
|
||||||
:exc:`~django.db.NotSupportedError` is raised.
|
:exc:`~django.db.NotSupportedError` is raised.
|
||||||
|
|
||||||
|
When using ``select_for_update()`` on MySQL, make sure you filter a queryset
|
||||||
|
against at least set of fields contained in unique constraints or only against
|
||||||
|
fields covered by indexes. Otherwise, an exclusive write lock will be acquired
|
||||||
|
over the full table for the duration of the transaction.
|
||||||
|
|
||||||
Automatic typecasting can cause unexpected results
|
Automatic typecasting can cause unexpected results
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user