Skip to content

Commit 2db988e

Browse files
authored
executor: fix privilege issue on table information_schema.tiflash_replica (pingcap#45319) (pingcap#45326)
close pingcap#45320
1 parent 9f3aa80 commit 2db988e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

executor/infoschema_reader.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,7 @@ func (e *memtableRetriever) setDataFromSequences(ctx sessionctx.Context, schemas
20632063

20642064
// dataForTableTiFlashReplica constructs data for table tiflash replica info.
20652065
func (e *memtableRetriever) dataForTableTiFlashReplica(ctx sessionctx.Context, schemas []*model.DBInfo) {
2066+
checker := privilege.GetPrivilegeManager(ctx)
20662067
var rows [][]types.Datum
20672068
progressMap, err := infosync.GetTiFlashTableSyncProgress(context.Background())
20682069
if err != nil {
@@ -2073,6 +2074,9 @@ func (e *memtableRetriever) dataForTableTiFlashReplica(ctx sessionctx.Context, s
20732074
if tbl.TiFlashReplica == nil {
20742075
continue
20752076
}
2077+
if checker != nil && !checker.RequestVerification(ctx.GetSessionVars().ActiveRoles, schema.Name.L, tbl.Name.L, "", mysql.AllPrivMask) {
2078+
continue
2079+
}
20762080
progress := 1.0
20772081
if !tbl.TiFlashReplica.Available {
20782082
if pi := tbl.GetPartitionInfo(); pi != nil && len(pi.Definitions) > 0 {

0 commit comments

Comments
 (0)