mysql事务问题演示
This commit is contained in:
20
MySQL/transaction-error/user_b.sql
Normal file
20
MySQL/transaction-error/user_b.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- example 1
|
||||
|
||||
-- ========== 1 =========
|
||||
start transaction;
|
||||
-- B插入数据
|
||||
insert into customer (id, username)
|
||||
values (1, 'Fortern'),
|
||||
(2, 'Maxin'),
|
||||
(3, 'MooGeo');
|
||||
commit;
|
||||
-- ========== 2 =========
|
||||
|
||||
|
||||
-- example 2
|
||||
-- ========== 1 =========
|
||||
start transaction;
|
||||
-- B 修改所有人的name
|
||||
update customer set username = '哈基米' where true;
|
||||
commit;
|
||||
-- ========== 2 =========
|
||||
Reference in New Issue
Block a user