Skip to content

fix: make SHOW metadata identifiers safe - #31033

Merged
XuPeng-SH merged 8 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/4d894776c6efbe2faf95f1aa5cbdb926b48bd21872318cac7036f0efe3176518
Oct 25, 2026
Merged

XuPeng-SH merged 8 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/4d894776c6efbe2faf95f1aa5cbdb926b48bd21872318cac7036f0efe3176518

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:

What this PR does / why we need it:

SHOW metadata commands generated SQL with unescaped table and column names, so valid identifiers containing apostrophes caused syntax errors. SHOW COLUMNS also looked up session temporary tables by their SQL alias instead of their physical catalog relation, returning no columns.

This change uses the shared SQL literal quoting helper for SHOW TABLE STATUS, SHOW COLUMNS, and SHOW INDEX generated SQL. It keeps temporary table display names separate from physical catalog names, so metadata output preserves the user-visible identifier while catalog scans use the resolved relation. Regression coverage includes quoted table and indexed-column names, permanent controls, and all DESC/SHOW COLUMNS variants on a live temporary table.

Validation completed at the reviewed HEAD:

  • planner targeted tests and complete pkg/sql/plan package: pass
  • frontend targeted test and complete pkg/frontend package: pass
  • authenticated embedded-cluster regression TestIssue30545ShowMetadataQuotedAndTemporaryTables: pass

The issue reporter should verify the SHOW metadata behavior after this PR is merged.

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

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 24, 2026
@mergify mergify Bot added the kind/bug Something isn't working label Oct 24, 2026
@iamlinjunhong
iamlinjunhong force-pushed the codex/loom/develop/4d894776c6efbe2faf95f1aa5cbdb926b48bd21872318cac7036f0efe3176518 branch from 173a706 to ddab2dd Compare October 24, 2026 11:19
@iamlinjunhong
iamlinjunhong force-pushed the codex/loom/develop/4d894776c6efbe2faf95f1aa5cbdb926b48bd21872318cac7036f0efe3176518 branch from ddab2dd to 3953ab4 Compare October 24, 2026 12:41
@XuPeng-SH

XuPeng-SH commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: eb1c0a92e091eb58390b5dcffafac765f6554543

Review completed. Read the assessment.

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

mo-bot review · mo-bot-local · review

Commit: eb1c0a92e091eb58390b5dcffafac765f6554543

Assessment: approve

Reviewed the complete delta and affected callers; no actionable findings remain. The change reuses the shared SQL quoting owner, resolves temporary metadata through the physical table name, and consistently updates SHOW COLUMNS protocol metadata. Added work is confined to SHOW metadata construction, without new queries, shared state, or ordinary SELECT/DML overhead.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • Passed 46 selected tests: 28 planner, 16 frontend, and 2 embedded SQL tests, with no failures or skips. Coverage includes quoted identifiers, temporary-table metadata, secondary-index statistics, and real MySQL result types.

  • Passed go vet for all three affected packages, changed-file Go formatting and whitespace checks, and source-cleanliness verification.

  • Isolation preflight passed. Verified 192 native build inputs and the retained library through the repository provenance owner before testing.

  • Reconciled commands, frozen-head fingerprints, zero exit receipts, and retained logs in /home/xupeng/.local/state/mo-bot/jobs/983cf46cc004f6c9df738fd3/attempt-1/evidence-audit.json. Frozen CI success statuses provide supplemental coverage.

Limitations:

  • Issue #30545's body was absent from frozen evidence; reviewed the behavioral contracts described in the PR and regression tests.

  • Full distributed suites were not rerun locally. No performance benchmark was run; the performance assessment follows the bounded SHOW-only code changes.

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

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-24 22:33 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-25 04:19 UTC · at 7a6a669fb2dd36c074dff87eccead70ae652ccd0

This pull request spent 5 hours 46 minutes 1 second in the queue, with no time running CI.

Reason

Pull request #31033 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.

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

  • Requeue this pull request

This branch had an error being deployed

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

Labels

dequeued kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants