Skip to content

Commit

Permalink
keyviz: fix the bug that table info cannot be obtained if the databas…
Browse files Browse the repository at this point in the history
…e name contains special chars (#840)

Signed-off-by: Zheng Xiangsheng <hundundm@gmail.com>
  • Loading branch information
HunDunDM authored and breezewish committed Feb 19, 2021
1 parent 679eb76 commit 977cb88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/keyvisual/decorator/tidb_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"context"
"encoding/json"
"fmt"
"net/url"
"strconv"
"time"

Expand Down Expand Up @@ -73,7 +74,8 @@ func (s *tidbLabelStrategy) updateMap(ctx context.Context) {
continue
}
var tableInfos []*model.TableInfo
if err := s.request(fmt.Sprintf("/schema/%s", db.Name.O), &tableInfos); err != nil {
encodeName := url.PathEscape(db.Name.O)
if err := s.request(fmt.Sprintf("/schema/%s", encodeName), &tableInfos); err != nil {
log.Error("fail to send schema request to TiDB", zap.Error(err))
updateSuccess = false
continue
Expand Down

0 comments on commit 977cb88

Please sign in to comment.