Opened 5 weeks ago

Closed 4 weeks ago

#31770 closed New feature (fixed)

Enable has_select_for_update_of feature on MySQL 8.0.1+.

Reported by: Simon Charette Owned by: Simon Charette
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Simon Charette)

While the SELECT FOR UPDATE documentation now mentions the OF option I 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.

Change History (7)

comment:1 Changed 5 weeks ago by Simon Charette

Description: modified (diff)
Summary: Enable has_select_for_update_of feature on MySQL 8Enable has_select_for_update_of feature on MySQL

comment:2 Changed 5 weeks ago by felixxm

Summary: Enable has_select_for_update_of feature on MySQLEnable has_select_for_update_of feature on MySQL 8.0.1+.
Triage Stage: UnreviewedAccepted
Version: 3.0master

It looks that it was officially added in 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.

comment:3 Changed 5 weeks ago 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.

comment:4 Changed 4 weeks ago by Simon Charette

Easy pickings: set
Owner: changed from nobody to Simon Charette
Status: newassigned

comment:5 Changed 4 weeks ago by Simon Charette

Has patch: set
Last edited 4 weeks ago by felixxm (previous) (diff)

comment:6 Changed 4 weeks ago by felixxm

Triage Stage: AcceptedReady for checkin

comment:7 Changed 4 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In ca6c5e5:

Fixed #31770 -- Allowed select_for_update(of) on MySQL 8.0.1+.

Note: See TracTickets for help on using tickets.
Back to Top