From 2aba5feb1502bf664934111cd52576bd80888caa Mon Sep 17 00:00:00 2001 From: Cao Kai Date: Mon, 24 Jun 2024 11:06:51 +0800 Subject: [PATCH] fix get role name of sys tables --- pkg/frontend/mysql_cmd_executor.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/frontend/mysql_cmd_executor.go b/pkg/frontend/mysql_cmd_executor.go index 3566beac432af..0c7086e281770 100644 --- a/pkg/frontend/mysql_cmd_executor.go +++ b/pkg/frontend/mysql_cmd_executor.go @@ -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" @@ -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) }