Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: write system timezone into mysql.tidb in bootstrap stage. #7638

Merged
merged 63 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ec6a822
get tz name from zoneinfo
zhexuany Sep 7, 2018
40f1caf
remove imports
zhexuany Sep 7, 2018
ad574a4
add comment
zhexuany Sep 7, 2018
e76c224
correct a spelling
zhexuany Sep 7, 2018
a74739c
called once for evalSys
zhexuany Sep 7, 2018
f0502c8
address comments
zhexuany Sep 7, 2018
ed136b9
remove unecessary import
zhexuany Sep 7, 2018
085dc79
Merge branch 'master' into get_tz_name_from_zoneinfo
zhexuany Sep 8, 2018
8ba623f
rewrite code
zhexuany Sep 8, 2018
13c7c1b
Merge branch 'get_tz_name_from_zoneinfo' of github.com:zhexuany/tidb …
zhexuany Sep 8, 2018
e962f82
print localStr out
zhexuany Sep 8, 2018
26f65f7
set time_zone in test
zhexuany Sep 8, 2018
d708186
align tz behavior with golang
zhexuany Sep 8, 2018
ceedc34
when tz is empty use localtime
zhexuany Sep 8, 2018
2adc1e8
adding timeutil package
zhexuany Sep 8, 2018
acc0262
make the use of time.Now in expression correct
zhexuany Sep 8, 2018
709c32c
remoeve unecessay file
zhexuany Sep 8, 2018
350d27d
adding test and debug print
zhexuany Sep 9, 2018
c95e6c3
print tz in initLocalStr
zhexuany Sep 9, 2018
21e9e22
move zone to timeutil
zhexuany Sep 9, 2018
a84c028
remove prev changes
zhexuany Sep 9, 2018
c1658d8
init localstr in bootstrap stage
zhexuany Sep 11, 2018
a517a43
init localstr in bootstrap stage
zhexuany Sep 11, 2018
b5e39b6
load system tz by select
zhexuany Sep 12, 2018
84b6e8f
address comment
zhexuany Sep 12, 2018
dae8a5a
correct test case
zhexuany Sep 12, 2018
5c373bf
fix conflict
zhexuany Sep 12, 2018
2d0aca2
fix ci
zhexuany Sep 12, 2018
e624443
remove shadow err
zhexuany Sep 12, 2018
f3ad3bc
remove err shadow
zhexuany Sep 12, 2018
692d4d5
address comment
zhexuany Sep 13, 2018
b32bdd2
remove extra print
zhexuany Sep 13, 2018
49454d5
add more comment
zhexuany Sep 13, 2018
318c12b
address comments
zhexuany Sep 13, 2018
cb5fd7d
address comments
zhexuany Sep 13, 2018
ec66759
fix build error
zhexuany Sep 13, 2018
a3c3cc4
fix test error
zhexuany Sep 13, 2018
3976eda
load system tz after bootstrap
zhexuany Sep 13, 2018
d522982
address comments
zhexuany Sep 13, 2018
dd2d0c9
move code around to avoid critical section
zhexuany Sep 13, 2018
29679ab
remove callback
zhexuany Sep 13, 2018
733331e
remove extra comment
zhexuany Sep 13, 2018
e9bb73b
polish comment of fn
zhexuany Sep 13, 2018
1d8ddfa
fix ci
zhexuany Sep 13, 2018
bd24bee
make code cleanner
zhexuany Sep 13, 2018
2f8018a
correct set time_zone behavior
zhexuany Sep 13, 2018
7d6ae04
add test
zhexuany Sep 13, 2018
d315b25
address comment
zhexuany Sep 13, 2018
5dc988b
fix comment spelling issue
zhexuany Sep 13, 2018
1f99ca1
use one hook
zhexuany Sep 13, 2018
e4418cf
remove boot
zhexuany Sep 13, 2018
44996c2
add extra space
zhexuany Sep 13, 2018
bd1693e
address comment
zhexuany Sep 14, 2018
fda4813
fix ci
zhexuany Sep 14, 2018
9986492
Merge branch 'master' into get_tz_name_from_zoneinfo
zhexuany Sep 14, 2018
1acd491
move code after checking errLoad
zhexuany Sep 14, 2018
65051bb
Merge branch 'get_tz_name_from_zoneinfo' of github.com:zhexuany/tidb …
zhexuany Sep 14, 2018
a37aeeb
add comment
zhexuany Sep 14, 2018
e20dc07
remove reset chk
zhexuany Sep 14, 2018
74d394a
rename local fn
zhexuany Sep 14, 2018
64a5b2e
fix ci
zhexuany Sep 14, 2018
e77ee43
fix ci
zhexuany Sep 14, 2018
1b53dff
Merge branch 'master' into get_tz_name_from_zoneinfo
zhexuany Sep 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion executor/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ package executor

import (
"math"
"path/filepath"
"runtime"
"sort"
"strings"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -139,9 +141,15 @@ func zone(sctx sessionctx.Context) (string, int64) {
if name == "Local" {
path, err := filepath.EvalSymlinks("/etc/localtime")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this function evaluated? If it is evaluated frequently, we need to cache the zone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

if err != nil {
log.Errorln(err)
return "Sysytem", int64(offset)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I have no idea why this happens. - - Already fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Sysytem/System

}
return getTZNameFromFileName(path), int64(offset)
name, err = getTZNameFromFileName(path)
if err != nil {
log.Errorln(err)
return "System", int64(offset)
}
return name, int64(offset)
}

return name, int64(offset)
Expand Down
1 change: 0 additions & 1 deletion store/mockstore/mocktikv/cop_handler_dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"path/filepath"
)

var dummySlice = make([]byte, 0)
Expand Down