Skip to content

Commit f0502c8

Browse files
committed
address comments
1 parent a74739c commit f0502c8

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

executor/distsql.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func closeAll(objs ...Closeable) error {
119119
return errors.Trace(err)
120120
}
121121

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

134134
var localStr string

store/mockstore/mocktikv/cop_handler_dag.go

-10
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,6 @@ func (h *rpcHandler) buildDAGExecutor(req *coprocessor.Request) (*dagContext, ex
165165
return ctx, e, dagReq, err
166166
}
167167

168-
func getTZNameFromFileName(path string) (string, error) {
169-
// phase1 only support read /etc/localtime which is a softlink to zoneinfo file
170-
substr := "share/zoneinfo"
171-
if strings.Contains(path, substr) {
172-
idx := strings.Index(path, substr)
173-
return string(path[idx+len(substr)+1:]), nil
174-
}
175-
return "", errors.New("only support softlink has share/zoneinfo as a suffix" + path)
176-
}
177-
178168
// constructTimeZone constructs timezone by name first. When the timezone name
179169
// is set, the daylight saving problem must be considered. Otherwise the
180170
// timezone offset in seconds east of UTC is used to constructed the timezone.

0 commit comments

Comments
 (0)