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

Session can access a table that has not been locked in this session. #31482

Open
CbcWestwolf opened this issue Jan 9, 2022 · 4 comments
Open
Assignees
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@CbcWestwolf
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

unlock tables;
drop table if exists t, s;
create table t (c int);
create table s (c int);
insert into s values (1),(2),(3);
insert into t values (1),(2),(3);
lock table t read;
select * from s;

2. What did you expect to see? (Required)

tidb > select * from s;
ERROR 1100 (HY000): Table 's' was not locked with LOCK TABLES

3. What did you see instead (Required)

tidb> select * from s;
+------+
| c    |
+------+
|    1 |
|    2 |
|    3 |
+------+
3 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

tidb_version(): Release Version: v5.4.0-alpha-652-g84e051834-dirty
Edition: Community
Git Commit Hash: 84e0518344d9826588db3644fee9065a9e729fef
Git Branch: master
UTC Build Time: 2022-01-09 12:14:35
GoVersion: go1.16
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@CbcWestwolf CbcWestwolf added the type/bug The issue is confirmed as a bug. label Jan 9, 2022
@djshow832
Copy link
Contributor

Is it the same with #28967?

@CbcWestwolf
Copy link
Member Author

Is it the same with #28967?

Not exactly. This issue refers to one session, while the issue you mentioned refers to two sessions.

@jebter jebter added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. sig/sql-infra SIG: SQL Infra labels Jan 11, 2022
@bb7133
Copy link
Member

bb7133 commented Jan 14, 2022

I don't think it's a major bug: the table lock is a 'hidden' feature(it is closed by default and not documented). I will mark it as 'minor' bug.

@bb7133 bb7133 added severity/minor and removed severity/major affects-5.0 This bug affects 5.0.x versions. labels Jan 14, 2022
@CbcWestwolf CbcWestwolf removed their assignment Jan 14, 2022
@CbcWestwolf
Copy link
Member Author

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants