Skip to content

Commit

Permalink
Merge branch 'master' into fix-race
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycs520 authored Jun 19, 2019
2 parents 9daec36 + eed6a9e commit 372a112
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions session/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,16 @@ func (s *testBootstrapSuite) TestOldPasswordUpgrade(c *C) {
c.Assert(err, IsNil)
c.Assert(newpwd, Equals, "*0D3CED9BEC10A777AEC23CCC353A8C08A633045E")
}

func (s *testBootstrapSuite) TestBootstrapInitExpensiveQueryHandle(c *C) {
defer testleak.AfterTest(c)()
store := newStore(c, s.dbName)
defer store.Close()
se, err := createSession(store)
c.Assert(err, IsNil)
dom := domain.GetDomain(se)
c.Assert(dom, NotNil)
defer dom.Close()
dom.InitExpensiveQueryHandle()
c.Assert(dom.ExpensiveQueryHandle(), NotNil)
}
2 changes: 1 addition & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,7 @@ func BootstrapSession(store kv.Storage) (*domain.Domain, error) {

timeutil.SetSystemTZ(tz)
dom := domain.GetDomain(se)
dom.InitExpensiveQueryHandle()

if !config.GetGlobalConfig().Security.SkipGrantTable {
err = dom.LoadPrivilegeLoop(se)
Expand Down Expand Up @@ -1543,7 +1544,6 @@ func BootstrapSession(store kv.Storage) (*domain.Domain, error) {
if err != nil {
return nil, err
}
dom.InitExpensiveQueryHandle()
if raw, ok := store.(tikv.EtcdBackend); ok {
err = raw.StartGCWorker()
if err != nil {
Expand Down

0 comments on commit 372a112

Please sign in to comment.