Open heni02 opened 1 day ago
main
44f4d5b47ba00287973ecb8b06d12066d9519593
- Hardware parameters: - OS type: - Others:
delete在显性事务中删除不存在的主键值,执行成功,但实际没有成功,导致再insert报dup的错误
试了下delete主键存在的值是没有问题的
2.0-dev也存在这个问题
No response
session1: mysql> create table test1(a int primary key,b int); Query OK, 0 rows affected (0.04 sec) mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> delete from test1 where a=1; Query OK, 0 rows affected (0.00 sec) mysql> insert into test1 values(1,10); Query OK, 1 row affected (0.01 sec) mysql> commit; Query OK, 0 rows affected (0.02 sec) session2: mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> delete from test1 where a=1; Query OK, 0 rows affected (6.61 sec) mysql> insert into test1 values(1,10); ERROR 1062 (HY000): Duplicate entry '1' for key 'a'
执行顺序: session1 commit之前,执行session2 delete ,然后session1 commit,之后session2 insert
Is there an existing issue for the same bug?
Branch Name
main
Commit ID
44f4d5b47ba00287973ecb8b06d12066d9519593
Other Environment Information
Actual Behavior
delete在显性事务中删除不存在的主键值,执行成功,但实际没有成功,导致再insert报dup的错误
试了下delete主键存在的值是没有问题的
2.0-dev也存在这个问题
Expected Behavior
No response
Steps to Reproduce
执行顺序: session1 commit之前,执行session2 delete ,然后session1 commit,之后session2 insert
Additional information
No response