matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 277 forks source link

[Bug]: pub+fulltext index,can not use select * from where match() against() #20210

Open tom-csf opened 1 day ago

tom-csf commented 1 day ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

44f4d5b47ba00287973ecb8b06d12066d9519593

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

image

Expected Behavior

No response

Steps to Reproduce

1、use root login
2、create database tpch_1g;
3、create table tab1(col1 int primary key, col2 text);
4、set experimental_fulltext_index=1;
insert into tab1 values (1, "hello world");
 insert into tab1 values (2, "hello world");
create fulltext index fdx1 on tab1(col2);
5、create account a1 ADMIN_NAME 'admin1' IDENTIFIED BY 'test123';
6、create publication pb2 database tpch_1g table tab1 account a1;
7、use a1 login //mysql -h 10.222.6.253 -ua1#admin1 -P6001 -ptest123
8、create database pb2 from sys publication pb2;
9、use pb2;
10、select * from tab1 where match(col2) against('hello');

Additional information

No response

cpegeric commented 17 hours ago

You can reproduce this case without fulltext index.

1、use root login 2、create database tpch_1g; 3、create table tab1(col1 int primary key, col2 text); insert into tab1 values (1, "hello world"); insert into tab1 values (2, "hello world"); 5、create account a1 ADMIN_NAME 'admin1' IDENTIFIED BY 'test123'; 6、create publication pb2 database tpch_1g table tab1 account a1; 7、use a1 login //mysql -h 10.222.6.253 -ua1#admin1 -P6001 -ptest123 8、create database pb2 from sys publication pb2; 9、use pb2; 10、select * from tpch_1g.tab1;

image
cpegeric commented 16 hours ago

This happens when fulltext_index_scan() table function run a SQL select count(*) from tpch_1g.tab1 and database tcph_1g database cannot be found.

This issue is that sql/compile/sql_executor_context.go CompilerContext doesn't have subscriptionMeta yet. I consider this is a not bug fix. It is rather a missing feature in CompilerContext.