Please answer these questions before submitting your issue. Thanks!
lock tablse sbtest1 read;
update sbtest1 set k = 2 where id = 1;
update unsuccessful
update success
MySQL [benchmark]> unlock tables;
Query OK, 0 rows affected (1.01 sec)
MySQL [benchmark]> lock table sbtest1 read;
Query OK, 0 rows affected (1.01 sec)
MySQL [benchmark]> insert into sbtest1 values(12121,3232,'a','df');
ERROR 1099 (HY000): Table 'sbtest1' was locked with a READ lock and can't be updated
MySQL [benchmark]> update sbtest1 set k=2 where id=1;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
master
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
@Lvnszn Could you check the config value of enable-table-lock is true? You can use the following SQL to query.
select * from information_schema.cluster_config where type='tidb' and `key` like "%lock%";
You need to make sure enable-table-lock is true when you want to use the table lock feature.
@crazycs520 I can reproduce it. This is because update with where goes PointGetPlan and this path is missing table lock check code.
Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: https://github.com/pingcap/tidb/issues/20100
Most helpful comment
@crazycs520 I can reproduce it. This is because update with where goes PointGetPlan and this path is missing table lock check code.