Skip to content

Commit

Permalink
rm bvt tag and modify cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariznawlll committed May 9, 2024
1 parent 469f099 commit 44a4d5e
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 149 deletions.
64 changes: 64 additions & 0 deletions test/distributed/cases/publication_subscription/pub_sub.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
drop account if exists test_tenant_1;
create account test_tenant_1 admin_name 'test_account' identified by '111';
drop database if exists republication01;
create database republication01;
use republication01;
create publication publication01 database republication01 account test_tenant_1 comment 'republish';
create table repub01(col1 int);
insert into repub01 values (1);
drop database if exists resub01;
create database resub01 from sys publication publication01;
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys republication01 2024-05-09 13:58:08 resub01 2024-05-09 13:58:08
drop database if exists database03;
create database database03;
use database03;
create table table01 (col1 int);
insert into table01 values (1);
insert into table01 select * from table01;
alter publication publication01 database database03;
show publications;
publication database create_time update_time sub_account comments
publication01 database03 2024-05-09 13:58:08 2024-05-09 13:58:08 test_tenant_1 republish
use resub01;
show tables;
Tables_in_resub01
table01
select * from table01;
col1
1
1
show columns from table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
desc table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
show table status;
Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Role_id Role_name
table01 Tae Dynamic 2 0 72 0 0 NULL 0 2024-05-09 13:58:08 NULL NULL utf-8 NULL 0 moadmin
alter publication publication01 database republication01;
show publications;
publication database create_time update_time sub_account comments
publication01 republication01 2024-05-09 13:58:08 2024-05-09 13:58:08 test_tenant_1 republish
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys republication01 2024-05-09 13:58:08 resub01 2024-05-09 13:58:08
use resub01;
show tables;
Tables_in_resub01
repub01
show columns from repub01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
desc repub01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
select * from repub01;
col1
1
drop publication publication01;
drop database database03;
drop database republication01;
drop account test_tenant_1;
55 changes: 55 additions & 0 deletions test/distributed/cases/publication_subscription/pub_sub.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
drop account if exists test_tenant_1;
create account test_tenant_1 admin_name 'test_account' identified by '111';

drop database if exists republication01;
create database republication01;
use republication01;
create publication publication01 database republication01 account test_tenant_1 comment 'republish';
create table repub01(col1 int);
insert into repub01 values (1);

-- @session:id=1&user=test_tenant_1:test_account&password=111
drop database if exists resub01;
create database resub01 from sys publication publication01;
-- @ignore:3,5
show subscriptions all;
-- @session

drop database if exists database03;
create database database03;
use database03;
create table table01 (col1 int);
insert into table01 values (1);
insert into table01 select * from table01;
alter publication publication01 database database03;
-- @ignore:2,3
show publications;

-- @session:id=2&user=test_tenant_1:test_account&password=111
use resub01;
show tables;
select * from table01;
show columns from table01;
desc table01;
-- @ignore:10,11,12
show table status;
-- @session

alter publication publication01 database republication01;
-- @ignore:2,3
show publications;

-- @session:id=3&user=test_tenant_1:test_account&password=111
-- @ignore:3,5
show subscriptions all;
use resub01;
show tables;
show columns from repub01;
desc repub01;
select * from repub01;
-- @session

drop publication publication01;
drop database database03;
drop database republication01;
drop account test_tenant_1;
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ col1 col2
create publication publication01 database database01 account test_tenant_1 comment 'publish database to account01';
show publications;
publication database create_time update_time sub_account comments
publication01 database01 2024-04-19 17:28:02 null test_tenant_1 publish database to account01
publication01 database01 2024-05-09 16:47:46 null test_tenant_1 publish database to account01
create database sub_database01 from sys publication publication01;
show databases;
Database
Expand All @@ -52,12 +52,12 @@ update table01 set col1 = 100 where col2 = 2413242;
internal error: cannot insert/update/delete from public table
show table status;
Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Role_id Role_name
table01 Tae Dynamic 2 0 104 0 0 NULL 0 2024-04-19 17:28:01 NULL NULL utf-8 NULL 0 moadmin
table01 Tae Dynamic 2 0 104 0 0 NULL 0 2024-05-09 16:47:45 NULL NULL utf-8 NULL 0 moadmin
drop table table01;
internal error: can not drop subscription table table01
show subscriptions;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys database01 2024-04-19 17:28:02 sub_database01 2024-04-19 17:28:02
publication01 sys database01 2024-05-09 16:47:46 sub_database01 2024-05-09 16:47:46
drop publication publication01;
drop database database01;
drop database if exists database01;
Expand All @@ -68,7 +68,7 @@ insert into t1 values (1, 1), (2, 2), (3, 3);
create publication publication01 database database01;
show publications;
publication database create_time update_time sub_account comments
publication01 database01 2024-04-19 17:28:02 null *
publication01 database01 2024-05-09 16:47:46 null *
drop account if exists test_tenant_1;
drop account if exists test_tenant_2;
create account test_tenant_1 admin_name 'test_account' identified by '111';
Expand All @@ -77,7 +77,7 @@ drop database if exists sub_database01;
create database sub_database01 from sys publication publication01;
show subscriptions;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys database01 2024-04-19 17:28:02 sub_database01 2024-04-19 17:28:03
publication01 sys database01 2024-05-09 16:47:46 sub_database01 2024-05-09 16:47:48
use sub_database01;
show tables;
Tables_in_sub_database01
Expand All @@ -100,12 +100,11 @@ col1
1
2
3
drop database if exists sub01;
drop database if exists sub_database01;
create database sub_database01 from sys publication publication01;
database sub_database01 already exists
show subscriptions;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys database01 2024-04-19 17:28:02 sub_database01 2024-04-19 17:28:03
publication01 sys database01 2024-05-09 16:47:46 sub_database01 2024-05-09 16:47:48
use sub_database01;
show tables;
Tables_in_sub_database01
Expand All @@ -131,12 +130,12 @@ insert into table03 values ('a', 'data warehouse');
create publication publication02 database database02;
show publications;
publication database create_time update_time sub_account comments
publication02 database02 2024-04-19 17:28:04 null *
publication02 database02 2024-05-09 16:47:49 null *
drop database if exists sub_database02;
create database sub_database02 from sys publication publication02;
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication02 sys database02 2024-04-19 17:28:04 sub_database02 2024-04-19 17:28:04
publication02 sys database02 2024-05-09 16:47:49 sub_database02 2024-05-09 16:47:49
use sub_database02;
show tables;
Tables_in_sub_database02
Expand All @@ -145,12 +144,11 @@ select * from table03;
col1 col2
1 database
a data warehouse
drop database if exists sub01;
drop database if exists sub_database02;
create database sub_database02 from sys publication publication02;
database sub_database02 already exists
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication02 sys database02 2024-04-19 17:28:04 sub_database02 2024-04-19 17:28:04
publication02 sys database02 2024-05-09 16:47:49 sub_database02 2024-05-09 16:47:49
use sub_database02;
show tables;
Tables_in_sub_database02
Expand All @@ -161,7 +159,7 @@ col1 col2
a data warehouse
show table status;
Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Role_id Role_name
table03 Tae Dynamic 2 0 160 0 0 NULL 0 2024-04-19 17:28:04 NULL NULL utf-8 NULL 0 moadmin
table03 Tae Dynamic 2 0 160 0 0 NULL 0 2024-05-09 16:47:49 NULL NULL utf-8 NULL 0 moadmin
drop publication publication02;
drop database if exists database03;
create database database03;
Expand All @@ -172,12 +170,12 @@ insert into table01 values (-1),(1),(2);
create publication publication03 database database03 account test_tenant_1;
show publications;
publication database create_time update_time sub_account comments
publication03 database03 2024-04-19 17:28:04 null test_tenant_1
publication03 database03 2024-05-09 16:47:49 null test_tenant_1
drop database if exists sub_database03;
create database sub_database03 from sys publication publication03;
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication03 sys database03 2024-04-19 17:28:04 sub_database03 2024-04-19 17:28:04
publication03 sys database03 2024-05-09 16:47:49 sub_database03 2024-05-09 16:47:49
use sub_database03;
show tables;
Tables_in_sub_database03
Expand All @@ -189,32 +187,30 @@ col1
2
desc table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
col1 INT(32) YES null
show table status;
Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Role_id Role_name
table01 Tae Dynamic 3 0 108 0 0 NULL 0 2024-04-19 17:28:04 NULL NULL utf-8 NULL 0 moadmin
table01 Tae Dynamic 3 0 108 0 0 NULL 0 2024-05-09 16:47:49 NULL NULL utf-8 NULL 0 moadmin
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication03 sys database03 2024-04-19 17:28:04 sub_database03 2024-04-19 17:28:04
alter publication publication03 account all;
show publications;
publication database create_time update_time sub_account comments
publication03 database03 2024-04-19 17:28:04 2024-04-19 17:28:04 *
publication03 database03 2024-05-09 16:47:49 2024-05-09 16:47:49 *
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication03 sys database03 2024-04-19 17:28:04 sub_database03 2024-04-19 17:28:04
publication03 sys database03 2024-05-09 16:47:49 null null
create database sub_database03 from sys publication publication03;
database sub_database03 already exists
use sub_database03;
show tables;
Tables_in_sub_database03
table01
show columns from table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
col1 INT(32) YES null
desc table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
col1 INT(32) YES null
select * from table01;
col1
-1
Expand All @@ -225,70 +221,15 @@ show publications;
publication database create_time update_time sub_account comments
use sub_database01;
internal error: there is no publication publication01
drop database if exists republication01;
create database republication01;
use republication01;
create publication publication01 database republication01 account test_tenant_1 comment 'republish';
create table repub01(col1 int);
insert into repub01 values (1);
drop database if exists resub01;
create database resub01 from sys publication publication01;
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys republication01 2024-04-19 17:28:04 resub01 2024-04-19 17:28:04
use sub_database01;
alter publication publication01 database database03;
use resub01;
show tables;
Tables_in_resub01
table01
select * from table01;
col1
-1
1
2
show columns from table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
desc table01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
show table status;
Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Role_id Role_name
table01 Tae Dynamic 3 0 108 0 0 NULL 0 2024-04-19 17:28:04 NULL NULL utf-8 NULL 0 moadmin
alter publication publication01 database republication01;
show publications;
publication database create_time update_time sub_account comments
publication01 republication01 2024-04-19 17:28:04 2024-04-19 17:28:05 test_tenant_1 republish
show subscriptions all;
pub_name pub_account pub_database pub_time sub_name sub_time
publication01 sys republication01 2024-04-19 17:28:04 resub01 2024-04-19 17:28:04
use resub01;
show tables;
Tables_in_resub01
repub01
show columns from repub01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
desc repub01;
Field Type Null Key Default Extra Comment
col1 INT(32) YES null
select * from repub01;
col1
1
drop publication publication01;
drop database database01;
drop database database02;
drop database database03;
drop database republication01;
drop database sub_database01;
drop database sub_database02;
drop database sub_database03;
drop database sub_database01;
Can't drop database 'sub_database01'; database doesn't exist
drop database sub_database01;
Can't drop database 'sub_database01'; database doesn't exist
drop database sub_database01;
Can't drop database 'sub_database01'; database doesn't exist
drop database sub_database02;
Can't drop database 'sub_database02'; database doesn't exist
drop database database01;
drop database database02;
drop database database03;
drop account test_tenant_1;
drop account test_tenant_2;
Loading

0 comments on commit 44a4d5e

Please sign in to comment.