Show grants using more than two roles return incorrect result #30855
Labels
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
affects-5.3
This bug affects 5.3.x versions.
affects-5.4
This bug affects the 5.4.x(LTS) versions.
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE DATABASE IF NOT EXISTS
tispark_test
;CREATE TABLE IF NOT EXISTS
tispark_test
.table_test
(i int, s varchar(128));CREATE ROLE IF NOT EXISTS 'test_read', 'test_write';
GRANT SELECT ON
tispark_test
.table_test
TO 'test_read'@'%';GRANT UPDATE ON
tispark_test
.table_test
TO 'test_write'@'%';CREATE USER IF NOT EXISTS 'tispark_unit_test_user' IDENTIFIED BY '';
GRANT 'test_read','test_write' TO 'tispark_unit_test_user'@'%';
SHOW GRANTS FOR 'tispark_unit_test_user'@'%' USING 'test_read','test_write';
2. What did you expect to see? (Required)
MySQL version: 8.0.27
3. What did you see instead (Required)
Actually, if I use command
SET ROLE 'test_read', 'test_write'
, it still can select rows from tabletispark_test
.table_test
. So I think it's a bug forSHOW GRANTS
4. What is your TiDB version? (Required)
TiDB version:5.3.0
The text was updated successfully, but these errors were encountered: