Repository navigation
Description
Existing issue search:
- I have searched existing issues to avoid duplicates
Branch Name: main
Commit ID: e2459cc55f4b514893e19732743460bc5f61d552(应为 e2459cc55f4b514893e19732743460bc5f16d552, 2026-11-09)
Environment: Local single-node launch (CN+TN+LogService in one launch config), macOS arm64, freshly compiled from current main, clean catalog. Client: mysql CLI.
Actual Behavior:
REVOKE ALL on a table only removes the row recorded as the "all" privilege; individually-granted privileges on the same table survive and keep working. After GRANT SELECT + GRANT ALL (which MO stores as two independent rows) followed by REVOKE ALL, the role still holds a working SELECT — the operator believes all access was revoked, but the grantee keeps table access.
Measured on current main (reproduced 3 times, and re-verified before filing):
CREATE DATABASE regr;
CREATE TABLE regr.t (id INT PRIMARY KEY, v INT);
CREATE ROLE gr1;
GRANT SELECT ON TABLE regr.t TO gr1;
GRANT ALL ON TABLE regr.t TO gr1;
SHOW GRANTS FOR ROLE gr1;
-- MO stores BOTH rows:
-- GRANT select ON table d.t `gr1`
-- GRANT table all ON table d.t `gr1`
REVOKE ALL ON TABLE regr.t FROM gr1;
SHOW GRANTS FOR ROLE gr1;
-- GRANT select ON table d.t `gr1` ← STILL PRESENT
-- and a user holding gr1 (activated via SET DEFAULT ROLE) can still SELECT the table.MySQL 8.3 comparison (verified on a live MySQL instance, same statements):
GRANT SELECTthenGRANT ALLare merged into a single rowGRANT ALL PRIVILEGES ON db.t(ALL is a privilege set, not an independent grant),- and
REVOKE ALLleaves nothing on that object (SHOW GRANTSshows onlyUSAGE).
So in MySQL the above sequence and revoke ends fully closed, while in MO the grantee retains SELECT after the operator's REVOKE ALL — the exact state the operator believes they have eliminated.
Expected Behavior:
REVOKE ALL ON <object> FROM <grantee> must remove every table-level privilege on that object currently held by the grantee (the full set: select/insert/update/delete/truncate/reference/index/execute/ownership), mirroring MySQL's REVOKE ALL PRIVILEGES. Alternatives that also close the gap: (a) at REVOKE-ALL time, expand "all" to the concrete privilege set and delete every matching row; or (b) implement MySQL's merge semantics at GRANT time (overwriting the member privileges into the ALL row). What must not happen: a "successful" REVOKE ALL that leaves a live privilege behind.
Steps to Reproduce (deterministic, fresh session):
-- 1. Setup
CREATE DATABASE regr;
CREATE TABLE regr.t (id INT PRIMARY KEY, v INT);
CREATE ROLE gr1;
CREATE USER gu1 IDENTIFIED BY 'U1!';
GRANT gr1 TO gu1;
SET DEFAULT ROLE gr1 TO gu1; -- activate
-- 2. Grant SELECT individually, then ALL on top
GRANT SELECT ON TABLE regr.t TO gr1;
GRANT ALL ON TABLE regr.t TO gr1;
SHOW GRANTS FOR ROLE gr1;
--+------------------------------------------+
--| Grants for gr1 |
--+------------------------------------------+
--| GRANT select ON table d.t `gr1` | ← two independent rows
--| GRANT table all ON table d.t `gr1` |
--+------------------------------------------+
-- 3. Revoke everything
REVOKE ALL ON TABLE regr.t FROM gr1; -- returns OK
SHOW GRANTS FOR ROLE gr1;
--| GRANT select ON table d.t `gr1` | ← select row survived
-- 4. Prove the surviving grant is live (login as gu1):
-- SELECT COUNT(*) FROM regr.t; → succeeds ❌ should be denied after REVOKE ALLSeverity: Security/audit — an operator-performed full revocation that leaves a live privilege is the classic "I revoked it, why can they still read it" failure. Combined with #32446 (SHOW GRANTS renders objects as literal d.t), auditors cannot even see what object the surviving grant is on.
Cross-reference:
- [Bug]: SHOW GRANTS renders granted object as literal 'd.t' #32446 — SHOW GRANTS object-name rendering defect (observed on the same rows)
- [Bug]: Column-level GRANT silently degrades to full-table grant #32443 / [Bug]: Object-level GRANT/REVOKE cannot target a user — misreports 'there is no role <user>' #32478 — grantee-resolution gaps in the same GRANT/REVOKE subsystem
Activity
[-][Bug]: REVOKE ALL leaves individually-granted privileges alive on the same object — grantee keeps table access after operator's full revocation[/-][+][Bug]: REVOKE ALL leaves individually-granted privileges alive[/+]gouhongshen commentedon Nov 12, 2026
Existing-fix audit
Assessment: already fixed on current main
Fixed evidence
Merged PR #32573, commit bbfc12b (2026-11-12), present in audited main c2f82ed. doRevokePrivilege routes exact-relation ALL revokes to getSqlForDeleteRelationAllRolePrivs, whose delete has no privilege_id filter. test/distributed/cases/zz_accesscontrol/grant_view_table_spelling.sql:185-201 reproduces SELECT + ALL on a base table, successful access, REVOKE ALL, then fresh-session denial; its committed .result:95-102 records that denial. Test_doRevokePrivilege also asserts that the ALL delete omits privilege_id. bbfc12b
XuPeng-SH commentedon Nov 12, 2026
QA 交接(main,待验证,不代表验收通过)
关联修复 #32573 已合入 main,merge SHA:
bbfc12bab4f410c26dbf06aa694acba51aba1734。已核对合并状态及实际修改:精确 relation 的REVOKE ALL使用不含privilege_id过滤的删除路径,清除同一 relation 的单项及 ALL 授权;提交的 BVT 覆盖基表叠加 SELECT + ALL 后撤销及新会话拒绝,直接对应本 issue。真实证据与限制:本轮仅远端阅读 issue 全部评论、PR diff 与验证记录,未运行本地测试。作者报告相关 BVT 110/110(默认入口两次)、旧版本失败对照、focused/full frontend UT 和相邻权限 BVT 通过;最终 PR 评审记录复用 CI 与作者证据。旧 BVT 清理全局变量问题已修正并复核,不是当前未完 follow-up。这些是已有报告,不是本轮在 merge SHA 上实测,也不等于 QA 验收。
建议 QA 在包含该 SHA 的 main 上复验原 SELECT + ALL → REVOKE ALL 场景,以实际访问拒绝和精确对象授权清除作为判据;覆盖限定/非限定名称、表/视图、单项叠加、缓存开关及会话边界,并保留相邻对象/角色与通配授权不被误撤销的控制。不要只依据 SHOW GRANTS 展示判断访问结果。
范围边界:精确对象撤销不清除独立的数据库/账户级授权;通配范围仍按对象类别处理。#32446 展示问题及 #32478 用户 grantee 支持不是本次修复结论。未发现当前适用的已验证反例或未完开发 follow-up,交由 QA 验证,issue 保持 open;不要求自动 backport。
slyunnn commentedon Nov 16, 2026
Partially fixed — #32479
Verified
origin/main4349e7321825639c0f9001e4271df278127060cf—perf(objectio): compress directly into available writer arena (#32774)— on a native2 CN / 1 TN / 1 Log service / Proxycluster, using MySQLCOM_QUERYthrough Proxy6001, CN116001and CN216002.PR #32573, commit
bbfc12bab4f410c26dbf06aa694acba51aba1734, fixes exact table/viewSELECT+ALLrevocation: exact privilege rows disappear and existing and fresh sessions are denied, with privilege cacheonandoff. Neighboring roles and independent wildcard grants are preserved. MOTR record and replay passed on all endpoints.Remaining issue, reproduced on all three endpoints with a fresh account and session:
Expected: no
SELECTgrant ond.*and access denied. Actual:SHOW GRANTSretainsGRANT SELECT ON TABLE d.*, and the fresh user session reads row1. Investigate the wildcard-scopeREVOKE ALLdeletion path and remove individually granted privileges at the same scope while preserving independent scopes and roles.4.2-devwas not tested. Large data is unnecessary because this is privilege-catalog and authorization behavior.MOTR source commit
1f8d4283c74ee603ce5c22a17f34879c4d424087covers the fixed exact-object scope; daily PR #347. The wildcard defect remains open.