[Django] #31770: Enable has_select_for_update_of feature on MySQL 8

11 views
Skip to first unread message

Django

unread,
Jul 7, 2020, 9:34:58 AM7/7/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8
-------------------------------------+-------------------------------------
Reporter: Simon | Owner: nobody
Charette |
Type: New | Status: new
feature |
Component: Database | Version: 3.0
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
While the `SELECT FOR UPDATE`
[https://dev.mysql.com/doc/refman/8.0/en/select.html#idm45705194357888
documentation now mentions the] `OF` option I
[https://www.oracle.com/search/results?Ntt=%22FOR%20UPDATE%20OF%22&Dy=1&Nty=1&cat=mysql&Ntk
=SI-ALL5 couldn't find a single entry in the release notes] so I'm not
sure which version of MySQL 8 supposedly added support for it.

All the `tests/select_for_update` tests happen to pass when setting
`has_select_for_update_of = True` even on MySQL 5.5 so I'm not sure if
this was always supported and never documented or if the syntax was always
allowed and they just recently added support for it?

In all cases it seems like the feature should be allowed since all
supported versions of MySQL allow it.

--
Ticket URL: <https://code.djangoproject.com/ticket/31770>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 7, 2020, 9:35:42 AM7/7/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Simon Charette:

Old description:

> While the `SELECT FOR UPDATE`
> [https://dev.mysql.com/doc/refman/8.0/en/select.html#idm45705194357888
> documentation now mentions the] `OF` option I
> [https://www.oracle.com/search/results?Ntt=%22FOR%20UPDATE%20OF%22&Dy=1&Nty=1&cat=mysql&Ntk
> =SI-ALL5 couldn't find a single entry in the release notes] so I'm not
> sure which version of MySQL 8 supposedly added support for it.
>
> All the `tests/select_for_update` tests happen to pass when setting
> `has_select_for_update_of = True` even on MySQL 5.5 so I'm not sure if
> this was always supported and never documented or if the syntax was
> always allowed and they just recently added support for it?
>
> In all cases it seems like the feature should be allowed since all
> supported versions of MySQL allow it.

New description:

While the `SELECT FOR UPDATE`
[https://dev.mysql.com/doc/refman/8.0/en/select.html#idm45705194357888
documentation now mentions the] `OF` option I
[https://www.oracle.com/search/results?Ntt=%22FOR%20UPDATE%20OF%22&Dy=1&Nty=1&cat=mysql&Ntk
=SI-ALL5 couldn't find a single entry in the release notes] so I'm not

sure which version of MySQL supposedly added support for it.

All the `tests/select_for_update` tests happen to pass when setting
`has_select_for_update_of = True` even on MySQL 5.5 so I'm not sure if
this was always supported and never documented or if the syntax was always

allowed and they just recently added support for it? Only the MySQL 8
documentation mentions it though.

In all cases it seems like the feature should be allowed since all
supported versions of MySQL allow it.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:1>

Django

unread,
Jul 7, 2020, 3:28:00 PM7/7/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8.0.1+.

-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* version: 3.0 => master
* stage: Unreviewed => Accepted


Comment:

It looks that it was officially added in
[https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html#mysqld-8-0-1-feature
MySQL 8.0.1]:

> ''"OF now is a reserved word and cannot be used as an identifier without
identifier quoting."''

`select_for_update` tests fail for me on MySQL 5.6 and 5.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:2>

Django

unread,
Jul 7, 2020, 4:02:40 PM7/7/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8.0.1+.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

> `select_for_update` tests fail for me on MySQL 5.6 and 5.7.

Not sure what I did wrong but I used `django-docker-box` with
`MYSQL_VERSION=5.5 docker-compose run --rm mysql --noinput
select_for_update`. I guess there might have been some Docker image
caching involved.

--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:3>

Django

unread,
Jul 12, 2020, 12:25:00 AM7/12/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8.0.1+.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Simon
| Charette
Type: New feature | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* owner: nobody => Simon Charette
* status: new => assigned
* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:4>

Django

unread,
Jul 12, 2020, 12:31:13 AM7/12/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8.0.1+.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Simon
| Charette
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:5>

Django

unread,
Jul 13, 2020, 4:18:31 AM7/13/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8.0.1+.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Simon
| Charette
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:6>

Django

unread,
Jul 13, 2020, 5:55:36 AM7/13/20
to django-...@googlegroups.com
#31770: Enable has_select_for_update_of feature on MySQL 8.0.1+.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Simon
| Charette
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"ca6c5e5fc23f2855a7094d195f09975b21a7ec3f" ca6c5e5]:
{{{
#!CommitTicketReference repository=""
revision="ca6c5e5fc23f2855a7094d195f09975b21a7ec3f"
Fixed #31770 -- Allowed select_for_update(of) on MySQL 8.0.1+.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31770#comment:7>

Reply all
Reply to author
Forward
0 new messages