github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/dml/replace/replace.test (about)

     1  -- @suite
     2  
     3  -- @case
     4  -- @desc:test for replace data
     5  -- @label:bvt
     6  drop table if exists names;
     7  create table names(id int PRIMARY KEY,name VARCHAR(255),age int);
     8  replace into names(id, name, age) values(1,"Abby", 24);
     9  select name, age from names where id = 1;
    10  replace into names(id, name, age) values(1,"Bobby", 25);
    11  select name, age from names where id = 1;
    12  replace into names set id = 2, name = "Ciro";
    13  select name, age from names where id = 2;
    14  replace into names set id = 2, name = "Ciro", age = 17;
    15  select name, age from names where id = 2;
    16  REPLACE INTO names values (2, "Bob", 19);
    17  select name, age from names where id = 2;
    18  -- table without keys
    19  drop table if exists t1;
    20  create table t1(a int, b int, c int);
    21  insert into t1 values (1,1,1), (2,2,2), (3,3,3);
    22  replace t1 values (1,2,3), (2,3,4);
    23  select a, b, c from t1;
    24  create table t4 (a int unique key, b varchar(64));
    25  replace into t4 values (1, 'a');
    26  select * from t4;
    27  replace into t4 values (1, 'b');
    28  select * from t4;