添加regression case test for concurrent update

This commit is contained in:
lvhui
2023-06-21 14:36:53 +08:00
parent 1190c0f3b5
commit 1384694653
5 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,25 @@
create database mysql_test dbcompatibility 'B';
\c mysql_test
create table tb666(c1 timestamp default current_timestamp on update current_timestamp, c2 int, c3 timestamp generated always as(c1+c2) stored);
insert into tb666 values(default, 1);
select * from tb666;
c1 | c2 | c3
--------------------------------+----+--------------------------------
--?.*
(1 row)
begin;
update tb666 set c2 = 2;
select * from tb666;
c1 | c2 | c3
---------------------------------+----+--------------------------------
--?.*
(1 row)
select pg_sleep(2);
pg_sleep
----------
(1 row)
commit;

View File

@ -0,0 +1,14 @@
select pg_sleep(2);
pg_sleep
----------
(1 row)
\c mysql_test
update tb666 set c2 = 3;
select * from tb666;
c1 | c2 | c3
---------------------------------+----+---------------------------------
--?.*
(1 row)

View File

@ -1088,3 +1088,5 @@ test: user_host_test
# test for new_expr_by_flatten
test: enable_expr_fusion_flatten
# test for on update timestamp and generated column
test: on_update_session1 on_update_session2

View File

@ -0,0 +1,10 @@
create database mysql_test dbcompatibility 'B';
\c mysql_test
create table tb666(c1 timestamp default current_timestamp on update current_timestamp, c2 int, c3 timestamp generated always as(c1+c2) stored);
insert into tb666 values(default, 1);
select * from tb666;
begin;
update tb666 set c2 = 2;
select * from tb666;
select pg_sleep(2);
commit;

View File

@ -0,0 +1,4 @@
select pg_sleep(2);
\c mysql_test
update tb666 set c2 = 3;
select * from tb666;