github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/dm/tests/dm_syncer/data/db1.increment.sql (about)

     1  use dm_syncer;
     2  insert into t1 (id, name) values (3, 'Eddard Stark');
     3  update t1 set name = 'Arya Stark' where id = 1;
     4  update t1 set name = 'Catelyn Stark' where name = 'catelyn';
     5  
     6  -- test multi column index with generated column
     7  alter table t1 add column info json;
     8  alter table t1 add column gen_id int as (info->"$.id");
     9  alter table t1 add index multi_col(`id`, `gen_id`);
    10  insert into t1 (id, name, info) values (4, 'gentest', '{"id": 123}');
    11  insert into t1 (id, name, info) values (5, 'gentest', '{"id": 124}');
    12  update t1 set info = '{"id": 120}' where id = 1;
    13  update t1 set info = '{"id": 121}' where id = 2;
    14  update t1 set info = '{"id": 122}' where id = 3;
    15  
    16  -- test genColumnCache is reset after ddl
    17  alter table t1 add column info2 varchar(40);
    18  insert into t1 (id, name, info) values (6, 'gentest', '{"id": 125, "test cache": false}');
    19  alter table t1 add unique key gen_idx(`gen_id`);
    20  update t1 set name = 'gentestxx' where gen_id = 123;
    21  
    22  insert into t1 (id, name, info) values (7, 'gentest', '{"id": 126}');
    23  update t1 set name = 'gentestxxxxxx' where gen_id = 124;
    24  -- delete with unique key
    25  delete from t1 where gen_id > 124;