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

     1  drop database if exists test;
     2  create database test;
     3  use test;
     4  
     5  drop table if exists test01;
     6  create table test01(
     7  col1 tinyint,
     8  col2 smallint,
     9  col3 int,
    10  col4 bigint,
    11  col5 tinyint unsigned,
    12  col6 smallint unsigned,
    13  col7 int unsigned,
    14  col8 bigint unsigned,
    15  col9 float,
    16  col10 double
    17  );
    18  
    19  insert into test01 values (1,2,3,4,5,6,7,8,10.2131,3824.34324);
    20  insert into test01 values (2,3,4,5,6,7,8,9,2131.3242343,-3824.34324);
    21  show create table test01;
    22  create publication publication01 database test;
    23  -- @ignore:2,3
    24  show publications;
    25  
    26  alter table test01 add primary key (col1, col2);
    27  show create table test01;
    28  alter table test01 add unique index `ui`(col1, col3);
    29  show create table test01;
    30  alter table test01 drop primary key;
    31  show create table test01;
    32  alter table test01 add primary key (col10);
    33  show create table test01;
    34  alter table test01 add column newCol int after col1;
    35  select * from test01;
    36  show create table test01;
    37  alter table test01 modify column col1 decimal;
    38  show create table test01;
    39  -- @ignore:2,3
    40  show publications;
    41  drop publication publication01;
    42  drop table test01;
    43  drop database test;
    44  
    45  
    46  drop account if exists acc0;
    47  create account acc0 admin_name 'root' identified by '111';
    48  drop database if exists sys_db_1;
    49  create database sys_db_1;
    50  use sys_db_1;
    51  create table sys_tbl_1(a int primary key, b decimal, c char, d varchar(20) );
    52  insert into sys_tbl_1 values(1,2,'a','database'),(2,3,'b','test publication'),(3, 4, 'c','324243243');
    53  create publication sys_pub_1 database sys_db_1;
    54  select * from sys_tbl_1;
    55  -- @ignore:2,3
    56  show publications;
    57  select pub_name, database_name, account_list from mo_catalog.mo_pubs;
    58  -- @session:id=2&user=acc0:root&password=111
    59  create database sub1 from sys publication sys_pub_1;
    60  show databases;
    61  -- @session
    62  
    63  -- @ignore:3,5
    64  show subscriptions;
    65  use sys_db_1;
    66  alter table sys_tbl_1 drop primary key;
    67  show create table sys_tbl_1;
    68  alter table sys_tbl_1 add primary key(a,b);
    69  show create table sys_tbl_1;
    70  alter table sys_tbl_1 add unique index `b`(b,c);
    71  show create table sys_tbl_1;
    72  alter table sys_tbl_1 modify column a char after c;
    73  show create table sys_tbl_1;
    74  
    75  -- @session:id=2&user=acc0:root&password=111
    76  drop database sub1;
    77  -- @session
    78  drop account acc0;
    79  drop publication sys_pub_1;
    80  drop database sys_db_1;
    81  
    82