-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
why there are so many kinds of "table lock" related syntax? #31767
Comments
@crazycs520 any idea? |
Is what I added for #25293, it's non-standard MySQL syntax and the feature is not a part of MySQL. |
|
I think some of the following are MySQL syntax:
|
It is an experimental feature in TiDB but a formal feature in MySQL. tidb> lock table t read;
Query OK, 0 rows affected, 1 warning (0.00 sec)
tidb> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------------------+
| Warning | 1235 | LOCK TABLES is not supported. To enable this experimental feature, set 'enable-table-lock' in the configuration file. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec) |
the following syntax are also MySQL syntax: lock table t read
lock table t read local
lock table t write
lock table t write local https://dev.mysql.com/doc/refman/8.0/en/lock-tables.html But TiDB add 2 special lock type: |
OK... and
They are seems to be bug, MySQL don't have such syntax and it's introduced in pingcap/parser#1095, |
|
The issue has not been updated for too long, so I will close it,if there are any updates, you can reopen it |
General Question
I want to lock the table to try the
@@tidb_enable_point_get_cache
, but misuse the syntax.I used
alter table t read only
... it doesn't work as expected.Then I take a glance at the parser.y file, and found we have soooooooooooooo many related syntax:
Each of the above statement is legal, no grammar check error.
But what does they mean? why sooooooooooooooooo many different syntax?
As a developer, I'm quite confused (not to say the real user).
The text was updated successfully, but these errors were encountered: