[MDEV-31569] LOCK IN SHARE MODE does not acquire lock correctly Created: 2023-06-28 Updated: 2023-08-07 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Locking |
| Affects Version/s: | 10.11.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Weng Siyang | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | index, locking | ||
| Description |
|
The schema is: create table table0 (pkId integer, pkAttr0 integer, pkAttr1 integer, coAttr0_0 integer, coAttr0_1 varchar(140), primary key(pkAttr0, pkAttr1)); Then execution queries below: session1 > begin; Since session1 acquire a lock on the record(pkAttr1=177), both of select in session2 should be blocked(because they use lock in share mode), but the first one is not blocked. We explain the plans of queries in session2 and find that the first one uses index but the second one does not use index. Maybe LOCK IN SHARE MODE does not lock the index entry correctly. |