From 4bae0874e0c26a55d499a53c39b6b9b9cd8000db Mon Sep 17 00:00:00 2001 From: yksitu <1297650644@qq.com> Date: Thu, 16 Jan 2025 09:42:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(sqlserver):=20=E4=BF=AE=E5=A4=8Dsqlserver?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=20#9084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db-priv/service/add_priv_base_func_for_sqlserver.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbm-services/mysql/db-priv/service/add_priv_base_func_for_sqlserver.go b/dbm-services/mysql/db-priv/service/add_priv_base_func_for_sqlserver.go index 7886ab9fca..a54f9275b3 100644 --- a/dbm-services/mysql/db-priv/service/add_priv_base_func_for_sqlserver.go +++ b/dbm-services/mysql/db-priv/service/add_priv_base_func_for_sqlserver.go @@ -169,12 +169,12 @@ func ImportSqlserverPrivilege(account TbAccounts, rules []TbAccountRules, bkClou if backendSQL, err = GenerateSqlserverSQL(account, rules, address, bkCloudId, s.InstanceRole); err != nil { return err } - if len(backendSQL) == 0 && s.InstanceRole == backendSlave { - // slave节点有可能不需要执行授权SQL,所以返回正常 + if len(backendSQL) == 0 { + // 返回正常,跳出 slog.Info( - fmt.Sprintf("[%s] no grant sql execute in slave instance [%s]", account.User, address), + fmt.Sprintf("[%s] no grant sql execute in instance [%s]", account.User, address), ) - return nil + continue } var queryRequest = QueryRequest{[]string{address}, backendSQL, false, 60, bkCloudId} _, err = OneAddressExecuteSqlserverSql(queryRequest)