github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/transaction/conflict_transation.result (about)

     1  create table ct_01(a int primary key,b varchar(25));
     2  insert into ct_01 values(1,'bell'),(2,'app'),(1,'com');
     3  Duplicate entry '1' for key 'a'
     4  insert into ct_01 values(1,'bell'),(2,'app');
     5  begin;
     6  insert into ct_01 values(3,'oppo'),(3,'zow');
     7  Duplicate entry '3' for key 'a'
     8  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
     9  use conflict_transation;
    10  start transaction ;
    11  insert into ct_01 values(2,'yooo');
    12  commit;
    13  Duplicate entry '2' for key 'a'
    14  commit;
    15  select * from ct_01;
    16  a    b
    17  1    bell
    18  2    app
    19  create table ct_02(a int primary key,b varchar(25));
    20  insert into ct_02 values(1,'bell'),(2,'app'),(3,'com');
    21  start transaction ;
    22  update ct_02 set a=5 where b='app';
    23  begin;
    24  update ct_02 set a=5 where b='bell';
    25  commit;
    26  commit;
    27  w-w conflict
    28  begin;
    29  update ct_02 set a=3 where b='bell';
    30  commit;
    31  Duplicate entry '3' for key 'a'
    32  select * from ct_02;
    33  a    b
    34  2    app
    35  3    com
    36  5    bell
    37  create table ct_03(a int primary key,b varchar(25));
    38  insert into ct_03 values(1,'bell'),(2,'app'),(3,'com');
    39  begin;
    40  delete from ct_03 where a=1;
    41  select * from ct_03;
    42  a    b
    43  2    app
    44  3    com
    45  begin;
    46  update ct_03 set b='urea' where a=1;
    47  select * from ct_03;
    48  a    b
    49  1    urea
    50  2    app
    51  3    com
    52  commit;
    53  commit;
    54  w-w conflict
    55  select * from ct_03;
    56  a    b
    57  2    app
    58  3    com
    59  1    urea
    60  create table ct_04_temp(a int,b varchar(25));
    61  insert into ct_04_temp values (1,'bell'),(2,'app'),(1,'com');
    62  create table ct_04(a int primary key,b varchar(25));
    63  begin;
    64  insert into ct_04 select * from ct_04_temp;
    65  Duplicate entry '1' for key 'a'
    66  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
    67  commit;
    68  select * from ct_04;
    69  a    b
    70  create table ct_05(a int,b varchar(25) primary key);
    71  begin;
    72  load data infile '$resources/load_data/ct_file.csv' into table ct_05;
    73  commit;
    74  Duplicate entry 'apple' for key 'b'
    75  select * from ct_05;
    76  a    b
    77  create table ct_06(a bigint,b varchar(25),c int, d varchar(25),primary key(a),unique index c(c),key b(b),key d(d));
    78  start transaction ;
    79  insert into ct_06 select 5678,'high',487,'comment test';
    80  insert into ct_06 select 5679,'lower',487,'define';
    81  Duplicate entry '487' for key '__mo_index_idx_col'
    82  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
    83  insert into ct_06 values (897,'number',908,'run tools'),(898,'string',908,'ffff'),(899,'string',918,'while'),(900,'string',948,'word file'),(901,'string',902,'oooo'),(902,'string',87,'dddd'),(903,'string',87,'eeee');
    84  Duplicate entry '908' for key '__mo_index_idx_col'
    85  select * from ct_06;
    86  a    b    c    d
    87  commit;
    88  select * from ct_06;
    89  a    b    c    d
    90  begin;
    91  insert into ct_06 values (500,'number1',908,'ooooffff');
    92  start transaction ;
    93  insert into ct_06 values (501,'number2',908,'zzzztttt');
    94  commit;
    95  select * from ct_06;
    96  a    b    c    d
    97  501    number2    908    zzzztttt
    98  commit;
    99  w-w conflict
   100  select * from ct_06;
   101  a    b    c    d
   102  501    number2    908    zzzztttt
   103  create table ct_07(a int,b varchar(25),c date, d double,primary key(a,c));
   104  insert into ct_07 values (1,'901','2011-09-29',0.01),(2,'187','2011-09-29',1.31),(3,'90','2111-02-09',10.01);
   105  begin;
   106  insert into ct_07 values (3,'90','2111-02-09',10.01);
   107  insert into ct_07 values (4,'11','2011-09-29',7.00),(2,'567','2011-09-29',1.31),(4,'90','2011-09-29',89.3);
   108  Duplicate entry '3a150441170b34c8' for key '__mo_cpkey_001a001c'
   109  Previous DML conflicts with existing constraints or data format. This transaction has to be aborted
   110  select * from ct_07;
   111  a    b    c    d
   112  1    901    2011-09-29    0.01
   113  2    187    2011-09-29    1.31
   114  3    90    2111-02-09    10.01
   115  commit;
   116  select * from ct_07;
   117  a    b    c    d
   118  1    901    2011-09-29    0.01
   119  2    187    2011-09-29    1.31
   120  3    90    2111-02-09    10.01