Skip to content

Conversation

@JetDrag
Copy link

@JetDrag JetDrag commented Nov 4, 2025

Fixes: #10134.

- make select(...).with_for_update(read=True) emit FOR SHARE on MySQL 8+ (still LOCK IN SHARE MODE on older versions)
- allow combining FOR SHARE with OF/NOWAIT/SKIP LOCKED when dialect.supports_for_share is true
- extend mysql FOR UPDATE compile tests to cover shared-lock variants

Usage snapshots:

select(User).with_for_update(read=True)                    → FOR SHARE (MySQL 8+) / LOCK IN SHARE MODE (pre-8)
select(User).with_for_update(read=True, nowait=True, of=User.__table__) → FOR SHARE OF users NOWAIT (MySQL 8+)

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, it looks ok.

could you also add a changelog file here https://github.com/sqlalchemy/sqlalchemy/tree/main/doc/build/changelog/unreleased_20 with summary of the change, similar to the other ones that are there, like https://github.com/sqlalchemy/sqlalchemy/blob/main/doc/build/changelog/unreleased_20/6511.rst?

thanks!

@zzzeek zzzeek requested a review from sqla-tester November 4, 2025 23:59
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

@zzzeek
Copy link
Member

zzzeek commented Nov 5, 2025

we've just moved to a new gerrit server and im using your PR to debug something, pardon the noise

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 2c6150b of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

New Gerrit review created for change 2c6150b: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6401

@JetDrag JetDrag closed this Nov 5, 2025
@JetDrag JetDrag reopened this Nov 5, 2025
@zzzeek
Copy link
Member

zzzeek commented Nov 5, 2025

hi just testing a comment here, ignore this

@sqla-tester
Copy link
Collaborator

Michael Bayer (zzzeek) wrote:

also testing a comment here

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6401

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 03d5e37 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

Patchset 03d5e37 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6401

@JetDrag
Copy link
Author

JetDrag commented Nov 5, 2025

thanks, it looks ok.

could you also add a changelog file here https://github.com/sqlalchemy/sqlalchemy/tree/main/doc/build/changelog/unreleased_20 with summary of the change, similar to the other ones that are there, like https://github.com/sqlalchemy/sqlalchemy/blob/main/doc/build/changelog/unreleased_20/6511.rst?

thanks!

Hi, @CaselIT, I've add the required changelog file 12964.rst. Review again plz.

@CaselIT
Copy link
Member

CaselIT commented Nov 6, 2025

thanks, I'll look at it soon

@sqla-tester
Copy link
Collaborator

Michael Bayer (zzzeek) wrote:

recheck

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for mysql syntax "for share skip locked"

4 participants