Opened 4 years ago

Closed 4 years 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: dev
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 by Simon Charette, 4 years ago

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

comment:2 by Mariusz Felisiak, 4 years ago

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 by Simon Charette, 4 years ago

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 by Simon Charette, 4 years ago

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

comment:5 by Simon Charette, 4 years ago

Has patch: set
Version 0, edited 4 years ago by Simon Charette (next)

comment:6 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

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