Skip to content

test: avoid stale account ids in statement info BVT - #29817

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/issue-29071
Oct 10, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/issue-29071

Conversation

@iamlinjunhong

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:

#29071

What this PR does / why we need it:

The statement query type BVT reused a fixed account-name predicate against system.statement_info. The planner can bind that name to a compile-time account ID, which becomes stale after rapid account DROP/CREATE propagation in multi-CN PROXY runs. The assertion now resolves the current account ID at execution time through mo_catalog.mo_account, while retaining the bounded exporter readiness wait and expected DDL accounting oracle. The mirrored .result query text is updated with the same predicate.

Validation

  • git diff --check
  • Exact assertion parsed with the MatrixOne MySQL parser.
  • GOWORK=off go test -mod=readonly ./pkg/sql/parsers/dialect/mysql -run '^TestQuantifiedTableSubqueryParse$' -count=1
  • Focused SQL/result mirror and stale-predicate checks passed.
  • Multi-CN PROXY mo-tester execution is pending the maintainer test environment; after merge, the issue reporter should rerun the exact BVT case on that topology.

@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 →

@mergify mergify Bot added the kind/test-ci label Oct 10, 2026
@matrix-meow matrix-meow added the size/XS Denotes a PR that changes [1, 9] lines label Oct 10, 2026

@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.

APPROVE at d733bea, base/merge-base 62827a1. Reviewed both changed hunks, the complete SQL/result case, issue #29071, the account-name rewrite owner and the runtime scalar-subquery path. No blocking finding. There are no substantive prior review comments or unresolved review threads on this PR.

The design is appropriately small for a BVT repair. QueryBuilder.convertAccountToAccountIdIfNeeded / ConvertAccountToAccountIdWithTableCheck resolves the old account-name equality during planning and substitutes a literal ID. The new expression reads the authoritative mo_catalog.mo_account row during execution; account_name is unique, and EXPLAIN confirms a runtime catalog/index scan feeding the scalar join. It adds no duplicate state, cache, validation mechanism or retry loop. The four statement types, stats version 6, complete attempt-count coverage, min/max attempt=1 and quality-bit check remain identical, as do the bounded 1s/60s readiness wait and account cleanup. SQL and .result contain the same exact assertion.

Independent exact-head validation on a clean, reviewer-owned macOS arm64 two-CN + PROXY topology, built through the repository Make/native provenance path:

  • The exact committed statement_query_type_3.sql ran in mo-tester normal comparison mode (-n -g -o, focused -i, distributed resources, optimistic exclusion), twice against the same instance: 64/64 passed both times, zero ignored/failed/abnormal. Case times were 9.023s and 2.917s; both process exit codes were 0. SQL and ISCP readiness preceded execution; proxy logs show connections routed to both CNs.
  • Between runs, and after the second, mo_catalog.mo_account contained zero rows for bvt_query_type/test_account, checked before the next entry-time cleanup could mask residue.
  • Adjacent negative controls: the exact assertion returned 0 with the account absent, then returned 0 for a newly recreated, empty same-name account while prior generations' DDL history remained (IDs 10001 and 10002; new ID 1). Historical rows therefore did not produce a false success. The final account was dropped and teardown rechecked.
  • Exact-head CI run 38026351189 is green. Downloaded artifacts show this file actually ran in the pessimistic group, 64/64 in 6.019s. The green PROXY job did NOT select it; the local topology run above fills that gap. git diff --check and exact SQL/result mirror checks passed. Service logs and mo-tester reports were inspected; owned processes were stopped.

Incremental cost: production 0 lines, documentation 0, test input/result +2/-2 across two files. The assertion adds a runtime catalog lookup/scalar join to a bounded BVT query; no production TP/prepared-statement execution code changes. No throughput benchmark is warranted for this test-only patch, and these functional runs are not a claim that every possible collector/propagation flake is eliminated. The underlying general account-name planner behavior is outside this repair's scope.

@mergify mergify Bot added the queued label Oct 10, 2026
@mergify

mergify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-10 06:37 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-10 06:51 UTC · at 84f12cd9d65e276c4ee2a8ef0044d679d86b56e3

This pull request spent 13 minutes 57 seconds in the queue, with no time running CI.

Reason

Pull request #29817 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch was previously deployed

1 inactive deployment
ci — 84f12cd9 Deployed Oct 10, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/XS Denotes a PR that changes [1, 9] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants