github.com/pingcap/ticdc@v0.0.0-20220526033649-485a10ef2652/tests/generate_column/data/prepare.sql (about)

     1  drop database if exists `generate_column`;
     2  create database `generate_column`;
     3  use `generate_column`;
     4  
     5  create table t (a int, b int as (a + 1) stored primary key);
     6  insert into t(a) values (1),(2), (3),(4),(5),(6),(7);
     7  update t set a = 10 where a = 1;
     8  update t set a = 11 where b = 3;
     9  delete from t where b=4;
    10  delete from t where a=4;
    11  
    12  create table t1 (a int, b int as (a + 1) virtual not null, c int not null, unique index idx1(b), unique index idx2(c));
    13  insert into t1 (a, c) values (1, 2),(2, 3), (3, 4),(4, 5),(5, 6),(6, 7),(7, 8);
    14  update t1 set a = 10 where a = 1;
    15  update t1 set a = 11 where b = 3;
    16  delete from t1 where b=4;
    17  delete from t1 where a=4;