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

     1  drop account if exists test_tenant_1;
     2  create account test_tenant_1 admin_name 'test_account' identified by '111';
     3  
     4  drop database if exists republication01;
     5  create database republication01;
     6  use republication01;
     7  create publication publication01 database republication01 account test_tenant_1 comment 'republish';
     8  create table repub01(col1 int);
     9  insert into repub01 values (1);
    10  
    11  -- @session:id=1&user=test_tenant_1:test_account&password=111
    12  drop database if exists resub01;
    13  create database resub01 from sys publication publication01;
    14  -- @ignore:3,5
    15  show subscriptions all;
    16  -- @session
    17  
    18  drop database if exists database03;
    19  create database database03;
    20  use database03;
    21  create table table01 (col1 int);
    22  insert into table01 values (1);
    23  insert into table01 select * from table01;
    24  alter publication publication01 database database03;
    25  -- @ignore:2,3
    26  show publications;
    27  
    28  -- @session:id=2&user=test_tenant_1:test_account&password=111
    29  use resub01;
    30  show tables;
    31  select * from table01;
    32  show columns from table01;
    33  desc table01;
    34  -- @ignore:10,11,12
    35  show table status;
    36  -- @session
    37  
    38  alter publication publication01 database republication01;
    39  -- @ignore:2,3
    40  show publications;
    41  
    42  -- @session:id=3&user=test_tenant_1:test_account&password=111
    43  -- @ignore:3,5
    44  show subscriptions all;
    45  use resub01;
    46  show tables;
    47  show columns from repub01;
    48  desc repub01;
    49  select * from repub01;
    50  -- @session
    51  
    52  drop publication publication01;
    53  drop database database03;
    54  drop database republication01;
    55  drop account test_tenant_1;