Skip to content

Commit

Permalink
fix(sqlserver): 修复sqlserver授权异常问题 #9084
Browse files Browse the repository at this point in the history
  • Loading branch information
yksitu committed Jan 16, 2025
1 parent 7c1f986 commit 4bae087
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4bae087

Please sign in to comment.