github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/optimistic/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  use conflict_transation;
     9  start transaction ;
    10  insert into ct_01 values(2,'yooo');
    11  commit;
    12  Duplicate entry '2' for key 'a'
    13  commit;
    14  select * from ct_01;
    15  a    b
    16  1    bell
    17  2    app
    18  create table ct_02(a int primary key,b varchar(25));
    19  insert into ct_02 values(1,'bell'),(2,'app'),(3,'com');
    20  start transaction ;
    21  update ct_02 set a=5 where b='app';
    22  begin;
    23  update ct_02 set a=5 where b='bell';
    24  commit;
    25  commit;
    26  w-w conflict
    27  begin;
    28  update ct_02 set a=3 where b='bell';
    29  commit;
    30  Duplicate entry '3' for key 'a'
    31  select * from ct_02;
    32  a    b
    33  2    app
    34  3    com
    35  5    bell
    36  create table ct_03(a int primary key,b varchar(25));
    37  insert into ct_03 values(1,'bell'),(2,'app'),(3,'com');
    38  begin;
    39  delete from ct_03 where a=1;
    40  select * from ct_03;
    41  a    b
    42  2    app
    43  3    com
    44  begin;
    45  update ct_03 set b='urea' where a=1;
    46  select * from ct_03;
    47  a    b
    48  1    urea
    49  2    app
    50  3    com
    51  commit;
    52  commit;
    53  w-w conflict
    54  select * from ct_03;
    55  a    b
    56  2    app
    57  3    com
    58  1    urea
    59  create table ct_04_temp(a int,b varchar(25));
    60  insert into ct_04_temp values (1,'bell'),(2,'app'),(1,'com');
    61  create table ct_04(a int primary key,b varchar(25));
    62  begin;
    63  insert into ct_04 select * from ct_04_temp;
    64  Duplicate entry '1' for key 'a'
    65  commit;
    66  select * from ct_04;
    67  a    b
    68  create table ct_05(a int,b varchar(25) primary key);
    69  begin;
    70  load data infile '$resources/load_data/ct_file.csv' into table ct_05 fields terminated by ',';
    71  Duplicate entry 'apple' for key 'b'
    72  commit;
    73  select * from ct_05;
    74  a    b
    75  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));
    76  start transaction ;
    77  insert into ct_06 select 5678,'high',487,'comment test';
    78  insert into ct_06 select 5679,'lower',487,'define';
    79  Duplicate entry '487' for key '__mo_index_idx_col'
    80  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');
    81  Duplicate entry '908' for key '__mo_index_idx_col'
    82  select * from ct_06;
    83  a    b    c    d
    84  5678    high    487    comment test
    85  commit;
    86  select * from ct_06;
    87  a    b    c    d
    88  5678    high    487    comment test
    89  begin;
    90  insert into ct_06 values (500,'number1',908,'ooooffff');
    91  start transaction ;
    92  insert into ct_06 values (501,'number2',908,'zzzztttt');
    93  commit;
    94  select * from ct_06;
    95  a    b    c    d
    96  501    number2    908    zzzztttt
    97  5678    high    487    comment test
    98  commit;
    99  w-w conflict
   100  select * from ct_06;
   101  a    b    c    d
   102  501    number2    908    zzzztttt
   103  5678    high    487    comment test
   104  create table ct_07(a int,b varchar(25),c date, d double,primary key(a,c));
   105  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);
   106  begin;
   107  insert into ct_07 values (3,'90','2111-02-09',10.01);
   108  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);
   109  Duplicate entry '(4,2011-09-29)' for key '__mo_cpkey_col'
   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  3    90    2111-02-09    10.01
   116  commit;
   117  Duplicate entry '3a150341170bc28c' for key '__mo_cpkey_col'
   118  select * from ct_07;
   119  a    b    c    d
   120  1    901    2011-09-29    0.01
   121  2    187    2011-09-29    1.31
   122  3    90    2111-02-09    10.01