summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaad <saad@share.fullhosts.com>2019-10-25 00:39:12 +0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-25 09:00:20 +0200
commit495cdd6add3abc37e2ff4e40c7df7e02eea4ce11 (patch)
treebe0b71f2bd374c28c3bc00bc1a250c752d90ee2a
parent6df42e6187121e641ea7250855f63edfb2ec005d (diff)
[3.0.x] Fixed #30904 -- Doc'd caveat about using filtered queryset with select_for_update() on MySQL.
Backport of fc2b1cc926e34041953738e58fa6ad3053059b22 from master
-rw-r--r--docs/ref/databases.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index 3b23a9dd51..4256395d78 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -630,6 +630,11 @@ the ``SELECT ... FOR UPDATE`` statement. If ``select_for_update()`` is used
with ``nowait=True``, ``skip_locked=True``, or ``of`` then a
: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
--------------------------------------------------