Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SELECT FOR UPDATE OF TABLES #28689

Closed
jackysp opened this issue Oct 9, 2021 · 5 comments · Fixed by #27861
Closed

Support SELECT FOR UPDATE OF TABLES #28689

jackysp opened this issue Oct 9, 2021 · 5 comments · Fixed by #27861
Labels
type/feature-request This is a feature requests on the product

Comments

@jackysp
Copy link
Member

jackysp commented Oct 9, 2021

Feature Request

Is your feature request related to a problem? Please describe:

For a multi-table join, a for update stmt locks all tables, some tables may not need to be locked.

Describe the feature you'd like:

Support the of tables syntax, which specifies that only some of the tables are locked. See https://dev.mysql.com/doc/refman/8.0/en/select.html for more details.
image

Describe alternatives you've considered:

No.

Teachability, Documentation, Adoption, Migration Strategy:

https://dev.mysql.com/doc/refman/8.0/en/select.html

@jackysp jackysp added the type/feature-request This is a feature requests on the product label Oct 9, 2021
@jackysp
Copy link
Member Author

jackysp commented Oct 9, 2021

PTAL @sunxiaoguang

@jackysp
Copy link
Member Author

jackysp commented Oct 9, 2021

PTAL @coocood @cfzjywxk

@tisonkun
Copy link
Contributor

@jackysp thanks for creating this issue.

@jackysp @cfzjywxk do you think we should prepare a design doc for this feature? It seems not a "huge" change but may be a significant change since it changes how locks work for TiDB.

As the pull request doesn't update parser dependency, I assume that this feature will change how SQL currently with "OF tables" works. Also we may want a clear plan for testing and get this feature general access.

What do you think?

@jackysp
Copy link
Member Author

jackysp commented Oct 11, 2021

I've updated parser, which didn't support the syntax of tables in the past. Our syntax documentation doesn't provide it either. So, I think this just extends the syntax and functionality. @tisonkun

@jackysp
Copy link
Member Author

jackysp commented Oct 11, 2021

I can write a design document for the pr, which is fine. @tisonkun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request This is a feature requests on the product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants