diff options
| author | kola-er <kola.erinoso@gmail.com> | 2019-11-04 22:44:10 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-11-05 14:34:40 +0100 |
| commit | d94d7b113c21d7a0fd802fadb1adbbec8155e880 (patch) | |
| tree | c0c5aa36e65d0abeaf3f31882b70d47cd36a10e3 /docs | |
| parent | edeec1247e52de6fc32cee93e96d4ce36003ea4b (diff) | |
Fixed #30928 -- Clarified MySQL/MariaDB support of QuerySet.select_for_update() options.
Thanks Par Andersson for reporting the issue.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/databases.txt | 15 | ||||
| -rw-r--r-- | docs/ref/models/querysets.txt | 5 |
2 files changed, 14 insertions, 6 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 5813fc03e6..736b5b77ee 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -625,10 +625,17 @@ both MySQL and Django will attempt to convert the values from UTC to local time. Row locking with ``QuerySet.select_for_update()`` ------------------------------------------------- -MySQL does not support the ``NOWAIT``, ``SKIP LOCKED``, and ``OF`` options to -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. +MySQL and MariaDB do not support some options to the ``SELECT ... FOR UPDATE`` +statement. If ``select_for_update()`` is used with an unsupported option, then +a :exc:`~django.db.NotSupportedError` is raised. + +=============== ========= ========== +Option MariaDB MySQL +=============== ========= ========== +``SKIP LOCKED`` X (≥8.0.1) +``NOWAIT`` X (≥10.3) X (≥8.0.1) +``OF`` +=============== ========= ========== 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 diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index e1d188b269..b8dcb90fec 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1706,8 +1706,9 @@ them:: <QuerySet [<Person: ...)>, ...]> Currently, the ``postgresql``, ``oracle``, and ``mysql`` database -backends support ``select_for_update()``. However, MySQL doesn't support the -``nowait``, ``skip_locked``, and ``of`` arguments. +backends support ``select_for_update()``. However, MariaDB 10.3+ supports only +the ``nowait`` argument and MySQL 8.0.1+ supports the ``nowait`` and +``skip_locked`` arguments. MySQL and MariaDB don't support the ``of`` argument. Passing ``nowait=True``, ``skip_locked=True``, or ``of`` to ``select_for_update()`` using database backends that do not support these |
