github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/optimistic/autocommit_atomicity.sql (about)

     1  drop table if exists test_11;
     2  create table test_11 (c int primary key,d int);
     3  
     4  set @@autocommit=0;
     5  Insert into test_11 values(1,1);
     6  Insert into test_11 values(2,2);
     7  Rollback;
     8  set @@autocommit=1;
     9  select * from test_11 ;
    10  
    11  set @@autocommit=0;
    12  Insert into test_11 values(1,1);
    13  Insert into test_11 values(2,2);
    14  commit;
    15  set @@autocommit=1;
    16  select * from test_11 ;
    17  
    18  drop table if exists test_11;
    19  create table test_11 (c int primary key,d int);
    20  Insert into test_11 values(1,1);
    21  Insert into test_11 values(2,2);
    22  Insert into test_11 values(3,1);
    23  Insert into test_11 values(4,2);
    24  set @@autocommit=0;
    25  delete from test_11 where c < 3;
    26  update test_11 set d = c + 1 where c >= 3;
    27  rollback;
    28  set @@autocommit=1;
    29  select * from test_11 ;
    30  
    31  set @@autocommit=0;
    32  delete from test_11 where c <3;
    33  update test_11 set d = c + 1 where c >= 3;
    34  commit;
    35  set @@autocommit=1;
    36  select * from test_11 ;
    37  
    38  drop table if exists test_11;
    39  set @@autocommit=0;
    40  create table test_11 (c int primary key,d int);
    41  Insert into test_11 values(1,1);
    42  Insert into test_11 values(2,2);
    43  Insert into test_11 values(3,1);
    44  Insert into test_11 values(4,2);
    45  rollback;
    46  set @@autocommit=1;
    47  select * from test_11 ;
    48  
    49  set @@autocommit=0;
    50  create table test_11 (c int primary key,d int);
    51  Insert into test_11 values(1,1);
    52  Insert into test_11 values(2,2);
    53  Insert into test_11 values(3,1);
    54  Insert into test_11 values(4,2);
    55  delete from test_11 where c <3;
    56  update test_11 set d = c + 1 where c >= 3;
    57  commit;
    58  set @@autocommit=1;
    59  select * from test_11;
    60  
    61  drop table if exists test_11;
    62  create table test_11 (c int primary key,d int);
    63  Insert into test_11 values(1,1);
    64  Insert into test_11 values(2,2);
    65  set @@autocommit=0;
    66  Insert into test_11 values(3,1);
    67  Insert into test_11 values(4,2);
    68  drop table if exists test_11;
    69  rollback;
    70  set @@autocommit=1;
    71  select * from test_11;
    72  
    73  drop table if exists test_11;
    74  create table test_11 (c int primary key,d int);
    75  Insert into test_11 values(1,1);
    76  Insert into test_11 values(2,2);
    77  set @@autocommit=0;
    78  Insert into test_11 values(3,1);
    79  Insert into test_11 values(4,2);
    80  drop table if exists test_11;
    81  commit;
    82  set @@autocommit=1;
    83  select * from test_11 ;
    84  
    85  
    86