Skip to content

fix: support fulltext scans over publications - #26702

Merged
mergify[bot] merged 11 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-20210-publication-fulltext
Aug 4, 2026
Merged

mergify[bot] merged 11 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-20210-publication-fulltext

Conversation

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #20210

What this PR does / why we need it:

Publication FULLTEXT rewrites currently serialize the published source table and its hidden index table as SQL strings, then execute that SQL with the subscriber account. Ordinary subscription scans retain publisher identity in ObjectRef.PubInfo, but the FULLTEXT FUNCTION_SCAN loses it.

This change:

  • resolves the hidden FULLTEXT index through the published source ObjectRef;
  • carries planner-trusted source/index references through TableFunction, Apply, duplicate, and remote pipeline protobuf paths;
  • validates that both references agree on publisher tenant, database, and subscription;
  • runs batch and streaming internal SQL with the publisher account/database while preserving the original transaction, snapshot context, cancellation, timezone, and variable resolver;
  • keeps direct/current-tenant fulltext_index_scan calls on their existing identity and prevents SQL string arguments from selecting an account;
  • preserves prepared-plan dependencies for the source table, hidden index, and subscription;
  • adds Publication + FULLTEXT BVT coverage for table/database publication, different aliases, quoted identifiers, two subscribers, index maintenance visibility, access denial, and prepared revoke/drop invalidation.

This supersedes/integrates the intent of #21836. It does not modify or take over that third-party Draft PR.

Evidence

  • Base 6091b418fd529badca4e1855843bd38804de396f: ordinary subscriber scan passed, but authorized subscriber MATCH ... AGAINST failed with Unknown database publisher_db.
  • Head f74b13cad1b817ad410b71f7504954727c3fc73a: the same production query passed. Live coverage also verified table/database publications, different aliases, quoted identifiers, two subscribers, insert/update/delete visibility, unpublished-table and catalog denial, prepared revoke/drop failure, and reauthorization recovery.
  • Passed:
    • go test -p=1 ./pkg/sql/plan
    • go test -p=1 ./pkg/sql/compile
    • go test -p=1 ./pkg/sql/colexec/table_function
    • go test -p=1 ./pkg/vectorindex/sqlexec
    • go list, go build, and go vet for the four affected packages
    • make build
    • git diff --check

Security boundary

Only planner-resolved ObjectRef.PubInfo can enable the publisher override. Runtime rejects partial or conflicting trusted references. The subscriber still cannot read unpublished publisher tables, hidden index tables, or publisher catalog rows.

QA

QA required: yes.

The checked-in BVT and protobuf round-trip tests are complete, but multi-CN placement, concurrent subscribers, index-update visibility, and revoke/drop must still be run in the distributed QA environment. Keep issue #20210 open through phase/testing until QA PASS.

@mergify

mergify Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-04 16:45 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-04 17:53 UTC · at 83d84fd72512c6dd6d46d1fdfeea48428e2f22ee · squash

This pull request spent 1 hour 7 minutes 11 seconds in the queue, including 37 minutes 57 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

@mergify
mergify Bot merged commit 8fc0655 into matrixorigin:main Aug 4, 2026
26 of 27 checks passed
@mergify mergify Bot removed the queued label Aug 4, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants