github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/pessimistic_transaction/special.sql (about)

     1  drop database if exists special;
     2  create database special;
     3  use special;
     4  set @@autocommit = 1;
     5  
     6  -- case 1
     7  # 2.primary key test
     8  create table t(a int primary key);
     9  insert into t select * from generate_series(1,200000) g;
    10  select count(*) from t;
    11  # abort,duplicate key
    12  -- @pattern
    13  insert into t select * from t;
    14  # transaction test
    15  begin;
    16  -- @pattern
    17  insert into t select * from t;
    18  select count(*) from t;
    19  commit;
    20  select count(*) from t;
    21  
    22  -- case 2
    23  begin;
    24  use special;
    25  create external table ex_table_dis(num_col1 tinyint,num_col2 smallint,num_col3 int,num_col4 bigint,num_col5 tinyint unsigned,num_col6 smallint unsigned,num_col7 int unsigned,num_col8 bigint unsigned ,num_col9 float(5,3),num_col10 double(6,5),num_col11 decimal(38,19)) infile{"filepath"='$resources/external_table_file/ex_table_number.csv'} fields terminated by ',' enclosed by '\"' lines terminated by '\n';
    26  select num_col1,num_col2 from ex_table_dis;
    27  -- @session:id=1{
    28  use special;
    29  select * from ex_table_dis;
    30  -- @session}
    31  update ex_table_dis set num_col1=1000;
    32  select num_col1,num_col2 from ex_table_dis;
    33  commit;
    34  select num_col1,num_col2 from ex_table_dis;
    35  
    36  drop database if exists special;