50 lines
1.1 KiB
Plaintext
50 lines
1.1 KiB
Plaintext
drop table if exists t1,t2,t3,t4;
|
|
create table t1(id int primary key, money1 int);
|
|
insert into t1(id,money1) values(1,100);
|
|
create table t2(id int primary key, money1 int);
|
|
insert into t2(id,money1) values(1,100);
|
|
select id,money1 from t1;
|
|
id money1
|
|
1 100
|
|
select id,money1 from t2;
|
|
id money1
|
|
1 100
|
|
id1 - 100 id2 + 100
|
|
begin;
|
|
update t1 set money1 = money1-100 where id = 1;
|
|
update t2 set money1 = money1+100 where id = 1;
|
|
commit;
|
|
select id,money1 from t1;
|
|
id money1
|
|
1 0
|
|
select id,money1 from t2;
|
|
id money1
|
|
1 200
|
|
drop table t1;
|
|
drop table t2;
|
|
create table t1(id int primary key, money1 int);
|
|
insert into t1(id,money1) values(1,100);
|
|
create table t2(id int primary key, money1 int);
|
|
insert into t2(id,money1) values(1,100);
|
|
select id,money1 from t1;
|
|
id money1
|
|
1 100
|
|
select id,money1 from t2;
|
|
id money1
|
|
1 100
|
|
id1 - 100 id2 + 100
|
|
begin;
|
|
update t1 set money1 = money1-100 where id = 1;
|
|
update t2 set money1 = money1+100 where id = 1;
|
|
ERROR HY000: OceanBase server has gone away
|
|
commit;
|
|
ERROR HY000: OceanBase server has gone away
|
|
select id,money1 from t1;
|
|
id money1
|
|
1 100
|
|
select id,money1 from t2;
|
|
id money1
|
|
1 100
|
|
drop table t1;
|
|
drop table t2;
|