Skip to content

Commit

Permalink
fix:not exist db (arana-db#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang authored and linguowei committed Feb 25, 2023
1 parent 7876dbe commit 7974f48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions pkg/boot/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,7 @@ func (fp *discovery) ListNodes(ctx context.Context, tenant, cluster, group strin
if !ok {
return nil, nil
}

var nodes []string
for i := range bingo.Nodes {
nodes = append(nodes, bingo.Nodes[i])
}

return nodes, nil
return append([]string{}, bingo.Nodes...), nil
}

func (fp *discovery) ListTables(ctx context.Context, tenant, cluster string) ([]string, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/mysql/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func (l *Listener) ValidateHash(handshake *handshakeResult) error {
} else { // login with schema
var ok bool
if tenant, ok = security.DefaultTenantManager().GetTenantOfCluster(handshake.schema); !ok {
return errors.NewSQLError(mysql.ERAccessDeniedError, mysql.SSAccessDeniedError, "Access denied for user '%v'", handshake.username)
return errors.NewSQLError(mysql.ERBadDb, mysql.SSSPNotExist, "Unknown database '%s'", handshake.schema)
}
err = doAuth(tenant)
}
Expand Down

0 comments on commit 7974f48

Please sign in to comment.