Skip to content

fix(sql): reject column privileges and render granted object scopes - #32649

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
aptend:fix/astra-meow-32443-32446
Nov 13, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
aptend:fix/astra-meow-32443-32446

Conversation

@aptend

@aptend aptend commented Nov 12, 2026 •

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:

Fixes #32443
Fixes #32446

What this PR does / why we need it:

  • Reject column-qualified GRANT/REVOKE with error 20105 before role lookup/persistence, while keeping whole-object grants unchanged.
  • Render SHOW GRANTS from the current account’s real catalog object/logical relation and database IDs, preserving role/user membership, global/unresolved-token fallback, and stable ordering.
  • Keep the column-privilege admission and SHOW GRANTS paths separate; this PR does not introduce direct per-user object grants or column-level authorization semantics.

Verification:

  • CGO_ENABLED=1 GOWORK=off STATIC_CHECK_PACKAGES=./... make static-check-selected: 0 issues with pinned molint + golangci 2.14.0, covering the full graph and reverse consumers.
  • make build on the patched tree succeeded; ELF and native artifacts are byte-identical to the accepted baseline.
  • Six canonical native BVT scripts: 1010 total, 992 successful, 18 existing-issue SKIP, 0 failed/abnormal; no SKIP was counted as success.
  • Directed SHOW GRANTS: seven expected/actual groups match; invalid quoted database names still return 20101/HY000.
  • Historical B phase-1/overall-5 remains unchanged; the captured-B checker yields old=1, new=0, with four negative controls rejected and the legal no-at-line form accepted.
  • Reused frontend/planner Go tests and foreground cleanup evidence: SQL cleanup rc=0, parent-wait rc=0/reaped, no survivors, owned data/lease released, TCP4/TCP6/UDP4/UDP6 all rc=0.
  • ADD INDEX was exercised in its real in-place route, not as a copy/ALTER claim.

@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 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

@XuPeng-SH

XuPeng-SH commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: fb85c8024e5401e6a627ff2e6fda1d4ab71aa85a

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: fb85c8024e5401e6a627ff2e6fda1d4ab71aa85a

Assessment: approve

The shared guard rejects unsupported column-qualified privileges before lookup or mutation, preserving whole-object grants. SHOW GRANTS reuses existing quoting and catalog identities to render account-scoped object names without changing membership or storage. No actionable findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Reviewed the complete delta, discussion, linked issues, and privilege, catalog-ID, rewrite and cleanup consumers.

  • Nine focused frontend/planner test roots passed: 16 executions including subtests, with no failures or skips.

  • Preflight, native provenance, Go 1.27.1 environment, clean-source, gofmt and diff checks passed; receipts and retained logs reconciled.

  • Verified fixture grant multisets and snapshot scope oracles. Reused frozen-head successful build, UT, SCA, coverage and BVT evidence.

Limitations:

  • Full server/BVT and broad package/static checks were not repeated locally. The author's six-script report includes 18 skipped cases, not passes.

  • CI and author reports lack raw per-case artifacts. Unmapped historical phase/binary claims were not used as current-head validation.

@mergify mergify Bot added the queued label Nov 13, 2026
@mergify
mergify Bot merged commit 2573b28 into matrixorigin:main Nov 13, 2026
@mergify

mergify Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

✅ Merged into main as 2573b28 at 00:31 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Fri 13 Nov, 00:31 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 00:31 · 2573b28 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — fb85c802 Deployed Nov 12, 2026 by aptend
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 size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SHOW GRANTS renders granted object as literal 'd.t' [Bug]: Column-level GRANT silently degrades to full-table grant

3 participants