Skip to content

[4.1] fix publication table lookup for quoted database names - #25532

Merged
mergify[bot] merged 2 commits into
matrixorigin:4.1-devfrom
gouhongshen:codex/fix-publication-chinese-db-4.1
Jul 9, 2026
Merged

[4.1] fix publication table lookup for quoted database names#25532
mergify[bot] merged 2 commits into
matrixorigin:4.1-devfrom
gouhongshen:codex/fix-publication-chinese-db-4.1

Conversation

@gouhongshen

Copy link
Copy Markdown
Contributor

What type of PR is this?

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

Which issue(s) this PR fixes:

issue matrixorigin/matrixflow#11551

4.1-dev port of #25518.

What this PR does / why we need it:

This ports the publication/subscription fix to 4.1-dev.

Root cause: table-level publication refresh builds show tables from <db> by raw string concatenation. Database names that require identifier quoting, such as Chinese database names or names containing backticks, produce invalid SQL or the wrong identifier.

Changes:

  • Quote the database name in showTablesFromDb with sqlquote.Ident.
  • Add a unit test covering Chinese database names and embedded backticks.
  • Add a BVT case for table-level publication from a Chinese-named source database, including table filtering checks so unpublished tables remain hidden.

Validation:

  • make build
  • go test -v -count=1 -timeout 120s ./pkg/frontend -run 'Test_showTablesFromDbQuotesDatabaseName' with MatrixOne CGo flags
  • git diff --check upstream/4.1-dev...HEAD

Note: local BVT execution against a temporary 4.1 MO did not complete because the local temporary MO process exited during mo-tester cleanup. The added BVT case itself already passed on the main PR CI/local run, and this PR includes it for 4.1 CI coverage.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the 4.1-dev port. The fix is the right direction: the table-level publication path validates explicit table lists via showTablesFromDb, and that SQL needs identifier quoting rather than raw concatenation. The caller passes a database identifier value, not a prebuilt SQL fragment, so sqlquote.Ident(dbName) is appropriate and does not affect DATABASE * because genPubTablesStr returns before calling showTablesFromDb for TABLE *.

Coverage looks adequate for this bug: the unit test covers non-ASCII names and embedded backticks at the generated SQL boundary, and the BVT covers create publication, alter publication, subscriber visibility, and the negative case that an unpublished table remains hidden. CI is green for UT, BVT, coverage, upgrade, and benchmark jobs.

No blocking findings.

@mergify mergify Bot added the queued label Jul 9, 2026
@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-09 08:35 UTC · Rule: release-4.1 · triggered by rule Automatic queue on approval for release-4.1
  • Checks passed · in-place
  • Merged2026-07-09 09:50 UTC · at c1ffa172dfd5d4e4fef34fbdf7db617ce9b933a8 · squash

This pull request spent 1 hour 15 minutes 26 seconds in the queue, including 1 hour 15 minutes 10 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • 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 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 Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • 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 Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • 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 Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)

@mergify
mergify Bot merged commit 5fc3e50 into matrixorigin:4.1-dev Jul 9, 2026
23 of 24 checks passed
@mergify mergify Bot removed the queued label Jul 9, 2026
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/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants