Skip to content

Commit

Permalink
fulltext case (matrixorigin#20631)
Browse files Browse the repository at this point in the history
add fulltext case

Approved by: @aressu1985
  • Loading branch information
Ariznawlll authored Dec 18, 2024
1 parent 8b4f1dc commit 10880e2
Show file tree
Hide file tree
Showing 11 changed files with 1,616 additions and 42 deletions.
623 changes: 623 additions & 0 deletions test/distributed/cases/fulltext/fulltext2.result

Large diffs are not rendered by default.

525 changes: 525 additions & 0 deletions test/distributed/cases/fulltext/fulltext2.sql

Large diffs are not rendered by default.

137 changes: 114 additions & 23 deletions test/distributed/cases/snapshot/restore_pub_sub.result
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
set experimental_fulltext_index=1;
set global enable_privilege_cache = off;
drop account if exists acc01;
create account acc01 admin_name = 'test_account' identified by '111';
drop account if exists acc02;
create account acc02 admin_name = 'test_account' identified by '111';
drop account if exists acc03;
create account acc03 admin_name = 'test_account' identified by '111';
drop account if exists acc04;
create account acc04 admin_name = 'test_account' identified by '111';
drop database if exists test01;
create database test01;
use test01;
Expand Down Expand Up @@ -43,17 +46,17 @@ drop publication if exists pub01;
create publication pub01 database test01 account all;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub01 test01 * * 2024-10-18 13:36:21 null
pub01 test01 * * 2024-12-17 15:51:00 null
show subscriptions all;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub01 sys test01 * 2024-10-18 13:36:21 null null 0
pub01 sys test01 * 2024-12-17 15:51:00 null null 0
drop database if exists sub01;
create database sub01 from sys publication pub01;
drop snapshot if exists sp01;
create snapshot sp01 for account acc01;
show snapshots;
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME
sp01 2024-10-18 05:36:21.963571 account acc01
sp01 2024-12-17 07:51:01.124788 account acc01
use sub01;
show tables;
Tables_in_sub01
Expand All @@ -77,7 +80,7 @@ pub_name pub_account pub_database pub_tables pub_comment pub_time
restore account acc01 from snapshot sp01;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub01 sys test01 * 2024-10-18 13:36:21 sub01 2024-10-18 13:36:22 0
pub01 sys test01 * 2024-12-17 15:51:00 sub01 2024-12-17 15:51:01 0
show databases;
Database
information_schema
Expand All @@ -93,10 +96,10 @@ use test01;
drop table aff01;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub01 test01 * * acc01 2024-10-18 13:36:21 null
pub01 test01 * * acc01 2024-12-17 15:51:00 null
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub01 sys test01 * 2024-10-18 13:36:21 sub01 2024-10-18 13:36:22 0
pub01 sys test01 * 2024-12-17 15:51:00 sub01 2024-12-17 15:51:01 0
show databases;
Database
information_schema
Expand Down Expand Up @@ -150,20 +153,20 @@ drop publication if exists pub02;
create publication pub02 database test02 table rs02 account acc01;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub02 test02 rs02 acc01 2024-10-18 13:36:23 null
pub02 test02 rs02 acc01 2024-12-17 15:51:02 null
show subscriptions all;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub02 sys test02 rs02 2024-10-18 13:36:23 null null 0
pub02 sys test02 rs02 2024-12-17 15:51:02 null null 0
drop database if exists sub02;
create database sub02 from sys publication pub02;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub02 sys test02 rs02 2024-10-18 13:36:23 sub02 2024-10-18 13:36:23 0
pub02 sys test02 rs02 2024-12-17 15:51:02 sub02 2024-12-17 15:51:02 0
drop snapshot if exists sp02;
create snapshot sp02 for account acc01;
show snapshots;
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME
sp02 2024-10-18 05:36:23.876662 account acc01
sp02 2024-12-17 07:51:02.40092 account acc01
drop database sub02;
drop publication pub02;
show subscriptions;
Expand Down Expand Up @@ -207,7 +210,7 @@ drop publication if exists pub03;
create publication pub03 database test03 account acc01;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub03 test03 * acc01 2024-10-18 13:36:25 null
pub03 test03 * acc01 2024-12-17 15:51:03 null
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
drop database if exists sub03;
Expand Down Expand Up @@ -273,12 +276,12 @@ drop publication if exists pub04;
create publication pub04 database test04 account sys comment 'pub to sys account';
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub04 test04 * sys 2024-10-18 13:36:27 null pub to sys account
pub04 test04 * sys 2024-12-17 15:51:04 null pub to sys account
drop database if exists sub05;
create database sub05 from acc01 publication pub04;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub04 acc01 test04 * pub to sys account 2024-10-18 13:36:27 sub05 2024-10-18 13:36:27 0
pub04 acc01 test04 * pub to sys account 2024-12-17 15:51:04 sub05 2024-12-17 15:51:04 0
drop snapshot if exists sp05;
create snapshot sp05 for account sys;
drop database sub05;
Expand Down Expand Up @@ -313,7 +316,7 @@ count(*)
1
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub04 acc01 test04 * pub to sys account 2024-10-18 13:36:27 sub05 2024-10-18 13:36:27 0
pub04 acc01 test04 * pub to sys account 2024-12-17 15:51:04 sub05 2024-12-17 15:51:05 0
drop database sub05;
drop snapshot sp05;
drop publication pub04;
Expand All @@ -338,25 +341,25 @@ drop publication if exists pub06;
create publication pub06 database test06 account acc02 comment 'acc01 pub to acc02';
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub06 test06 * acc02 2024-10-18 13:36:28 null acc01 pub to acc02
pub06 test06 * acc02 2024-12-17 15:51:05 null acc01 pub to acc02
drop database if exists sub06;
create database sub06 from acc01 publication pub06;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub06 acc01 test06 * acc01 pub to acc02 2024-10-18 13:36:28 sub06 2024-10-18 13:36:28 0
pub06 acc01 test06 * acc01 pub to acc02 2024-12-17 15:51:05 sub06 2024-12-17 15:51:05 0
restore account acc01 from snapshot sp06;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub06 acc01 null null null null sub06 2024-10-18 13:36:28 2
pub06 acc01 null null null null sub06 2024-12-17 15:51:05 2
use sub06;
internal error: there is no publication pub06
drop publication if exists pub06;
create publication pub06 database test06 table table01 account acc02 comment 'acc01 pub to acc02';
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub06 test06 table01 acc02 acc02 2024-10-18 13:36:28 null acc01 pub to acc02
pub06 test06 table01 acc02 acc02 2024-12-17 15:51:15 null acc01 pub to acc02
show databases;
Database
information_schema
Expand Down Expand Up @@ -417,17 +420,17 @@ drop database if exists sub06;
create database sub06 from sys publication pub06;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub06 sys test07 * 2024-10-18 13:36:29 sub06 2024-10-18 13:36:29 0
pub06 sys test07 * 2024-12-17 15:51:17 sub06 2024-12-17 15:51:17 0
drop snapshot if exists sp06;
create snapshot sp06 for account sys;
alter publication pub06 account acc02 database test07;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub06 sys null null null null sub06 2024-10-18 13:36:29 1
pub06 sys null null null null sub06 2024-12-17 15:51:17 1
restore account sys from snapshot sp06;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub06 sys null null null null sub06 2024-11-14 17:27:55 2
pub06 sys null null null null sub06 2024-12-17 15:51:17 2
drop database sub06;
drop publication pub06;
internal error: publication 'pub06' does not exist
Expand Down Expand Up @@ -476,19 +479,107 @@ system_metrics
test01
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub10 sys null null null null sub01 2024-11-14 17:27:56 2
pub10 sys null null null null sub01 2024-12-17 15:51:19 2
drop database sub01;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub11 sys null null null null sub02 2024-10-18 13:36:32 2
pub11 sys null null null null sub02 2024-12-17 15:51:19 2
drop database sub02;
drop publication pub10;
internal error: publication 'pub10' does not exist
drop database test01;
drop snapshot sp10;
drop database if exists pub_fulltext_table;
create database pub_fulltext_table;
use pub_fulltext_table;
drop table if exists src;
create table src (id bigint primary key, json1 text, json2 varchar);
insert into src values (0, '{"a":1, "b":"redredredredredredredredredredrerr"}', '{"d": "happybirthday.happy-birthday_happybirthday", "f":"winterautumnsummerspring"}'),
(1, '{"a":2, "b":"中文學習教材"}', '["apple", "orange", "banana", "指引"]'),
(2, '{"a":3, "b":"redbluebrownyelloworange"}', '{"d":"兒童中文"}');
create fulltext index ftidx on src (json1) with parser json_value;
drop publication if exists pub_full01;
create publication pub_full01 database pub_fulltext_table account acc01;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
pub_full01 pub_fulltext_table * acc01 2024-12-17 15:51:19 null
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
drop database if exists sub_pull01;
create database sub_pull01 from sys publication pub_full01;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub_full01 sys pub_fulltext_table * 2024-12-17 15:51:19 sub_pull01 2024-12-17 15:51:20 0
drop snapshot if exists sp_pub01;
create snapshot sp_pub01 for account sys;
drop publication pub_full01;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub_full01 sys null null null null sub_pull01 2024-12-17 15:51:20 2
restore account sys database pub_fulltext_table from snapshot sp_pub01;
show publications;
publication database tables sub_account subscribed_accounts create_time update_time comments
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub_full01 sys null null null null sub_pull01 2024-12-17 15:51:20 2
use sub_pull01;
internal error: there is no publication pub_full01
select * from src;
No database selected
drop database pub_fulltext_table;
drop snapshot sp_pub01;
drop publication pub_full01;
internal error: publication 'pub_full01' does not exist
drop database if exists restore_fulltext_table;
create database restore_fulltext_table;
use restore_fulltext_table;
drop table if exists src2;
create table src2 (id1 varchar, id2 bigint, body char(128), title text, primary key (id1, id2));
insert into src2 values ('id0', 0, 'red', 't1'), ('id1', 1, 'yellow', 't2'), ('id2', 2, 'blue', 't3'), ('id3', 3, 'blue red', 't4');
create fulltext index ftidx2 on src2 (body, title);
drop publication if exists pub_full02;
create publication pub_full02 database restore_fulltext_table account acc01;
drop database if exists fulltext_sub02;
create database fulltext_sub02 from sys publication pub_full02;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub_full02 sys restore_fulltext_table * 2024-12-17 15:51:20 fulltext_sub02 2024-12-17 15:51:20 0
pub_full01 sys null null null null sub_pull01 2024-12-17 15:51:20 2
drop snapshot if exists sp_full02;
create snapshot sp_full02 for account acc01;
drop publication pub_full02;
drop database fulltext_sub02;
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
pub_full01 sys null null null null sub_pull01 2024-12-17 15:51:20 2
restore account acc01 from snapshot sp_full02;
show databases;
Database
db01
information_schema
mo_catalog
mysql
system
system_metrics
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
restore account acc01 from snapshot sp_full02 to account acc04;
show databases;
Database
db01
information_schema
mo_catalog
mysql
system
system_metrics
show subscriptions;
pub_name pub_account pub_database pub_tables pub_comment pub_time sub_name sub_time status
drop database restore_fulltext_table;
drop snapshot sp_full02;
drop account acc01;
drop account acc02;
drop account acc03;
drop account acc04;
show snapshots;
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME
show publications;
Expand Down
Loading

0 comments on commit 10880e2

Please sign in to comment.