Bug #119490 savepoint
Submitted: 2 Dec 7:48
Reporter: Trevor Trevor Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version: 8.0.41 OS:Any
Assigned to: CPU Architecture:Any

[2 Dec 7:48] Trevor Trevor
Description:
According to the official documentation, row locks acquired after a savepoint will be held until the end of the transaction.but the following scenario will not hold the row lock.

How to repeat:
drop table t1;
create table t1(id int PRIMARY KEY, name varchar(255));
insert into t1 values (1,'A'),(2,'B');

T1:
begin;
T2:
begin;
T1:
SAVEPOINT savepoint1;
update t1 set name = 'AA' where id = 1;
ROLLBACK TO SAVEPOINT savepoint1;
T2:
update t1 set name = 'BB' where id = 1; -- Successful execution, with no blocking

Note:
if T1 before SAVEPOINT savepoint1; excute some sql,like select * from t1;
T2 will experience expected block.