Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany committed Sep 7, 2018
1 parent a74739c commit f0502c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions executor/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func closeAll(objs ...Closeable) error {
return errors.Trace(err)
}

// GetTZNameFromFileName gets IANA timezone name from zoninfo path.
// GetTZNameFromFileName gets IANA timezone name from zoneinfo path.
// TODO It will be refined later. This is just a quick fix.
func GetTZNameFromFileName(path string) (string, error) {
// phase1 only support read /etc/localtime which is a softlink to zoneinfo file
Expand All @@ -128,7 +128,7 @@ func GetTZNameFromFileName(path string) (string, error) {
idx := strings.Index(path, substr)
return string(path[idx+len(substr)+1:]), nil
}
return "", errors.New("only support softlink has share/zoneinfo as a suffix" + path)
return "", errors.New("only support softlink has share/zoneinfo in the middle" + path)
}

var localStr string
Expand Down
10 changes: 0 additions & 10 deletions store/mockstore/mocktikv/cop_handler_dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,6 @@ func (h *rpcHandler) buildDAGExecutor(req *coprocessor.Request) (*dagContext, ex
return ctx, e, dagReq, err
}

func getTZNameFromFileName(path string) (string, error) {
// phase1 only support read /etc/localtime which is a softlink to zoneinfo file
substr := "share/zoneinfo"
if strings.Contains(path, substr) {
idx := strings.Index(path, substr)
return string(path[idx+len(substr)+1:]), nil
}
return "", errors.New("only support softlink has share/zoneinfo as a suffix" + path)
}

// constructTimeZone constructs timezone by name first. When the timezone name
// is set, the daylight saving problem must be considered. Otherwise the
// timezone offset in seconds east of UTC is used to constructed the timezone.
Expand Down

0 comments on commit f0502c8

Please sign in to comment.