github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/tenant/pub_sub2.sql (about) 1 set global enable_privilege_cache = off; 2 create account a1 ADMIN_NAME 'admin1' IDENTIFIED BY 'test123'; 3 create account a2 ADMIN_NAME 'admin2' IDENTIFIED BY 'test456'; 4 5 create database sub1; 6 create table sub1.t1 (a int,b int); 7 insert into sub1.t1 values (1, 1), (2, 2), (3, 3); 8 9 create publication pub1 database sub1; 10 create publication pub3 database sub1; 11 -- @ignore:2,3 12 show publications; 13 -- @ignore:2,3 14 show publications like 'pub%'; 15 -- @ignore:2,3 16 show publications like '%1'; 17 18 create database sub2; 19 create table sub2.t1 (a float); 20 21 create publication pub2 database sub2 account a1; 22 -- @ignore:2,3 23 show publications; 24 -- @ignore:2,3 25 show publications like 'pub%'; 26 -- @ignore:2,3 27 show publications like '%1'; 28 29 -- @session:id=1&user=a1:admin1&password=test123 30 -- @ignore:3,5 31 show subscriptions; 32 -- @ignore:3,5 33 show subscriptions all; 34 -- @ignore:3,5 35 show subscriptions all like '%1'; 36 37 create database syssub1 from sys publication pub1; 38 -- @ignore:3,5 39 show subscriptions; 40 -- @ignore:3,5 41 show subscriptions all; 42 43 use syssub1; 44 show tables; 45 -- @ignore:3,5 46 show subscriptions all; 47 -- @ignore:10 48 show table status; 49 -- @ignore:10 50 show table status like 't1'; 51 desc t1; 52 show create table t1; 53 54 select * from t1; 55 -- @session 56 57 -- @session:id=2&user=a2:admin2&password=test456 58 -- @ignore:3,5 59 show subscriptions all; 60 -- @session 61 62 alter publication pub2 account all; 63 -- @ignore:2,3 64 show publications; 65 66 -- @session:id=2&user=a2:admin2&password=test456 67 -- @ignore:3,5 68 show subscriptions all; 69 -- @session 70 71 -- alter db 72 alter publication pub1 database sub2; 73 -- @ignore:2,3 74 show publications; 75 76 -- @session:id=1&user=a1:admin1&password=test123 77 -- @ignore:3,5 78 show subscriptions; 79 use syssub1; 80 show tables; 81 select * from t1; 82 -- @session 83 84 -- @session:id=1&user=a1:admin1&password=test123 85 drop database syssub1; 86 -- @session 87 88 drop publication pub1; 89 drop publication pub2; 90 drop publication pub3; 91 drop database sub1; 92 drop database sub2; 93 drop account a1; 94 drop account a2;