Repository navigation
Description
Existing issue search:
- I have searched existing issues to avoid duplicates
Branch Name: main
Commit ID: e2459cc55f4b514893e19732743460bc5f16d552 (2026-11-09)
Environment: Local single-node launch (CN + TN + LogService in one process tree), macOS arm64, freshly compiled from current main, clean catalog.
Actual Behavior:
A SELECT privilege granted on a view is stored correctly in the catalog but never honored at query time — the user holding it still gets do not have privilege when selecting the view, on the latest main.
Clean separation experiment (same role, same activation, base table vs view):
- Role
r_vvgranted SELECT on base table: works, query returns data. - Role
r_vvgranted SELECT on view: authorization row lands inmo_catalog.mo_role_privs(verified viaobj_idjoin), role is activated viaSET DEFAULT ROLE, root can query the view fine (view itself is valid) — yet the user's SELECT on the view is rejected withERROR 20101: do not have privilege to execute the statement.
Reproduced identically through multiple independent paths (fresh users, fresh roles, grant-before-user, grant-after-user), consistently on current main. This is a functional privilege-enforcement defect (granted-but-not-enforced), not a setup error.
Expected Behavior:
A user with an activated role holding SELECT on a view should be able to SELECT from that view. Either the grant must be enforced, or the GRANT statement should fail loudly at grant time.
Steps to Reproduce:
-- 1. Setup: base table + view
CREATE DATABASE bh2;
CREATE TABLE bh2.base (id INT PRIMARY KEY, v INT);
INSERT INTO bh2.base VALUES (1, 100);
CREATE VIEW bh2.vw AS SELECT id FROM bh2.base;
-- 2. Grant SELECT on the VIEW to a role, then to a user
CREATE ROLE r_vv;
GRANT SELECT ON TABLE bh2.vw TO r_vv;
CREATE USER u_vv IDENTIFIED BY 'B2!';
GRANT r_vv TO u_vv;
SET DEFAULT ROLE r_vv TO u_vv; -- activate
-- 3. Verify the grant really landed in the catalog (as root)
SELECT rp.obj_id, rp.privilege_name
FROM mo_catalog.mo_role_privs rp
JOIN mo_catalog.mo_role r ON rp.role_id = r.role_id
WHERE r.role_name = 'r_vv';
-- → row exists: obj_id=<view's rel_id>, privilege_name='select' ✓ stored
-- 4. root queries the view — works (view is valid)
SELECT * FROM bh2.vw; -- → 1
-- 5. u_vv queries the SAME view with the granted, activated role
-- (login as u_vv)
SELECT * FROM bh2.vw;
-- → ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
-- ❌ rejected despite stored grant + activated role
-- 6. Control: grant SELECT on the BASE TABLE to the same role
GRANT SELECT ON TABLE bh2.base TO r_vv;
-- (login as u_vv again; default role re-activated)
SELECT * FROM bh2.base; -- → works ✓
-- so the role/activation machinery is fine — only the VIEW object is not honoredSeverity: High — view-level grants are a standard mechanism for exposing subsets of tables to less-privileged users; this makes the entire feature non-functional (grants silently unenforced).
Cross-reference: Verified at least 3 times on 2026-11-09/10 against current main e2459cc55f, including via brand-new users/roles/paths. Related display layer symptom: SHOW GRANTS FOR ROLE renders the object as literal d.t for view grants (reported separately), suggesting the view-grant handling path is incomplete end-to-end.
Activity
[-][Bug]: SELECT privilege granted on a VIEW is stored but never enforced — user still denied with do not have privilege[/-][+][Bug]: SELECT privilege on a VIEW is stored but never enforced[/+]gouhongshen commentedon Nov 11, 2026
PR #32573 is trying to fix this issue.
fix(frontend): enforce and revoke view privileges across stored spell…
fix(frontend): enforce and revoke view privileges across stored spell…
gouhongshen commentedon Nov 12, 2026
PR #32573 has merged and is awaiting manual validation. The issue remains open.
XuPeng-SH commentedon Nov 12, 2026
QA handoff: #32573 merged into main at bbfc12b (2026-11-12 06:15 UTC; PR head d03ab9c). The original stored-but-denied view SELECT grant is covered, along with exact-relation cross-spelling/cross-class revoke and REVOKE ALL cleanup. Full issue discussion and final PR discussion/patch were checked; no current verified counterexample or unfinished development follow-up was found. The earlier BVT global-cache cleanup finding is fixed in the merged patch, not an outstanding blocker.
Evidence already reported by the author: original reproduction fails on base and succeeds after repair; focused revoke UT (137 assertions), full frontend package, 110/110 BVT twice, OFF-entry cache restoration, and adjacent 58/58 and 200/200 BVT controls. After rebasing onto 4760bca, the focused grant/cache/revoke tests were rerun. Final-head review reports reused successful CI checks, but did not independently inspect raw runtime logs. These are existing author/review reports, not tests run during this handoff.
QA should rerun the original SQL on the merged build, then cover TABLE/VIEW/bare and qualified/unqualified grants, fresh-session revocation, SELECT+ALL layering, cache OFF/ON/transitions, and tenant isolation. Exact-relation revokes intentionally clear alternate stored spellings; wildcard grants remain object-class-specific and database/account grants remain independent. SHOW GRANTS literal d.t rendering is a separate unfixed display issue. No new local runtime/race/performance or production-rollout validation was performed here. Transfer is for QA validation, not acceptance or issue closure.
slyunnn commentedon Nov 13, 2026
Regression and extended verification for #32444 (2026-11-13)
Verification Environment
Frozen target:
main@b6f5f597b8923b0f6d762e3b18243f39e49c5840, ci: allow reviewed 4.2 PRs from the designated approver to queue (#32656). Remote fetched at test start; the service binary was rebuilt for this exact commit using matching native inputs and confirmed by actualgit_version()at all endpoints. Local macOS arm64 topology:2 CN / 1 TN / 1 Log service / Proxy. Original and extended SQL actually ran via Proxy6001, CN116001, CN216002on loopback, using PyMySQL text protocol and Java/JDBC BVT. Endpoints were exercised, not merely health-checked.What Was Covered
grant_view_table_spelling.sql:110/110per endpoint with metadata comparison (330/330total), including qualification differences, SELECT/ALL layering, tenant isolation, wildcard/class separation, and global-cache restoration.d.tdisplay defect, production rollout/concurrency, or other maintenance branches.Findings
Associated repair: PR #32573, fix(frontend): enforce and revoke view privileges across stored spellings (merge
bbfc12bab4f410c26dbf06aa694acba51aba1734). Exact relation identity is honored across stored object classes and qualification spellings; wildcard grants retain their separate class scope. Revocation does not leave alternate exact-object rows authorizing fresh sessions.Large-data regression required: No. The boundary is relation authorization, role/cache state and revocation; one stored row plus isolated roles/users exposes it. More table data would add unrelated cost.
MOTR / BVT Coverage
Existing BVT and focused tests were reused. No duplicate MOTR case/commit or empty PR was created. Global-cache and catalog cases ran serially, with restoration and teardown. This does not claim forced MatrixOne engine parallelism or full CI/race success.
Final Conclusion
Fixed for the tested
mainview-grant enforcement and exact-relation revoke scope. The separate grant-display issue is not included.