You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: pub+fulltext index,can not use select * from where match() against() #20210
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.
Reproduced deterministically on exact main6091b418fd529badca4e1855843bd38804de396f in an isolated single-CN deployment.
A non-sys publisher created publisher_db.articles, a FULLTEXT index, and a table-level publication to a non-sys subscriber.
The publisher query select id from articles where match(body) against('hello') returned id = 1.
The subscriber created the subscription as a different alias, and an ordinary scan returned both published rows.
The subscriber FULLTEXT query failed with ERROR 1049 (HY000): Unknown database publisher_db.
This locates the failure in the generated FULLTEXT internal SQL: the plan carries the publisher database name, but the internal SQL executor still uses the subscriber account context. I am implementing a scoped fix that derives publisher execution identity only from planner-resolved source/index object references; user table-function arguments will not be able to select an account. QA remains required for multi-CN, revoke/drop, and cross-tenant permission validation.
Merge commit and main head: 8fc0655ac55fad63960f7c433b01cbad2fe7e7c6
Automated evidence: exact-head Ubuntu UT, Linux arm64 SCA, coverage, Proxy Compose BVT, and pessimistic launch BVT passed. The PR also adds publication + FULLTEXT BVT and protobuf round-trip coverage.
Remaining QA: test a deployed build containing the merge with table and database publications, multiple concurrent subscribers, differing subscription aliases, FULLTEXT index update visibility, and revoke/drop invalidation across multi-CN placement. Verify that an authorized subscriber MATCH ... AGAINST query returns the expected published rows and never exposes unpublished publisher objects or catalog data.
Expected PASS: the subscriber FULLTEXT terminal results match the publisher-visible authorized data through create, insert/update/delete, revoke/drop, and reauthorization scenarios. On FAIL, include MatrixOne version/build, environment/topology, SQL or fixture, terminal error/result, and relevant statement or log evidence. Keep this issue open until explicit tester PASS.
Activity
cpegeric commentedon Nov 21, 2024
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;
cpegeric commentedon Nov 21, 2024
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.
38 remaining items
VioletQwQ-0 commentedon Aug 4, 2026
Reproduced deterministically on exact
main6091b418fd529badca4e1855843bd38804de396fin an isolated single-CN deployment.publisher_db.articles, a FULLTEXT index, and a table-level publication to a non-sys subscriber.select id from articles where match(body) against('hello')returnedid = 1.ERROR 1049 (HY000): Unknown database publisher_db.This locates the failure in the generated FULLTEXT internal SQL: the plan carries the publisher database name, but the internal SQL executor still uses the subscriber account context. I am implementing a scoped fix that derives publisher execution identity only from planner-resolved source/index object references; user table-function arguments will not be able to select an account. QA remains required for multi-CN, revoke/drop, and cross-tenant permission validation.
fix: support fulltext scans over publications (#26702)
VioletQwQ-0 commentedon Aug 4, 2026
QA handoff for merged PR #26702.
83d84fd72512c6dd6d46d1fdfeea48428e2f22ee8fc0655ac55fad63960f7c433b01cbad2fe7e7c6Remaining QA: test a deployed build containing the merge with table and database publications, multiple concurrent subscribers, differing subscription aliases, FULLTEXT index update visibility, and revoke/drop invalidation across multi-CN placement. Verify that an authorized subscriber
MATCH ... AGAINSTquery returns the expected published rows and never exposes unpublished publisher objects or catalog data.Expected PASS: the subscriber FULLTEXT terminal results match the publisher-visible authorized data through create, insert/update/delete, revoke/drop, and reauthorization scenarios. On FAIL, include MatrixOne version/build, environment/topology, SQL or fixture, terminal error/result, and relevant statement or log evidence. Keep this issue open until explicit tester PASS.
Ariznawlll commentedon Aug 7, 2026
测试版本
mainab49099c0f487255df131f45c3aecf4a4650fed7原问题验证
非 sys 发布者创建 FULLTEXT index 并发布表/库后,订阅账户以不同数据库 alias 查询
MATCH ... AGAINST,可返回被授权的发布数据。Happy Path 覆盖
id=1;CN2 执行发布端 insert/update/delete 后,CN1 订阅端命中id=2,3,总行数为 2。Unhappy Path 覆盖
secret_table,也不能用直接的 fulltext table-function 参数选择发布者私有对象。白盒验证
不适用。跨账户身份、对象可见性、撤销和跨 CN 数据更新均通过公开 SQL 验证。
回归测试
执行
pub_sub_fulltext.sql对应场景及独立双 CN 场景;未新增代码或回归文件。测试证据
测试结论
测试通过。
Ariznawlll commentedon Aug 12, 2026
关闭说明:原 publication + FULLTEXT 查询路径已在 current
main完成单 CN、双 CN 黑盒验证,订阅账户通过不同数据库 alias 执行MATCH ... AGAINST均返回正确结果,权限隔离与异常路径也已覆盖。该问题属于权限、目录解析和 FULLTEXT 查询组合的功能语义,不依赖规模阈值,因此不需要额外加入 big-data 回归。测试证据见:#20210 (comment)
fix: support fulltext scans over publications (matrixorigin#26702)
fix: support fulltext scans over publications (matrixorigin#26702)
fix: support fulltext scans over publications (matrixorigin#26702)