Skip to content

Commit

Permalink
fix get role name of sys tables (#17102)
Browse files Browse the repository at this point in the history
fix get role name of mo_catalog.database/tables/columns in `show table status`

Approved by: @daviszhen, @sukki37
  • Loading branch information
ck89119 authored Jun 24, 2024
1 parent 0d78264 commit 80cf8cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/frontend/mysql_cmd_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/confluentinc/confluent-kafka-go/v2/kafka"
"github.com/fagongzi/goetty/v2"
"github.com/google/uuid"
"github.com/matrixorigin/matrixone/pkg/catalog"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

Expand Down Expand Up @@ -406,8 +407,12 @@ func handleShowTableStatus(ses *Session, execCtx *ExecCtx, stmt *tree.ShowTableS
}
roleId := row[17].(uint32)
// role name
if row[18], err = getRoleName(roleId); err != nil {
return err
if tableName == catalog.MO_DATABASE || tableName == catalog.MO_TABLES || tableName == catalog.MO_COLUMNS {
row[18] = moAdminRoleName
} else {
if row[18], err = getRoleName(roleId); err != nil {
return err
}
}
mrs.AddRow(row)
}
Expand Down

0 comments on commit 80cf8cb

Please sign in to comment.