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

session: fix unseccessfully isolation read engines init session (#16465) #16482

Merged
merged 8 commits into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions tidb-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ func setGlobalVars() {
variable.SysVars[variable.Socket].Value = cfg.Socket
variable.SysVars[variable.DataDir].Value = cfg.Path
variable.SysVars[variable.TiDBSlowQueryFile].Value = cfg.Log.SlowQueryFile
variable.SysVars[variable.TiDBIsolationReadEngines].Value = strings.Join(cfg.IsolationRead.Engines, ", ")

// For CI environment we default enable prepare-plan-cache.
plannercore.SetPreparedPlanCache(config.CheckTableBeforeDrop || cfg.PreparedPlanCache.Enabled)
Expand Down
33 changes: 33 additions & 0 deletions tidb-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@

package main

<<<<<<< HEAD
import "testing"
=======
import (
"testing"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/sessionctx/variable"
)
>>>>>>> 39cc893... session: fix unseccessfully isolation read engines init session (#16465)

var isCoverageServer = "0"

Expand All @@ -24,3 +34,26 @@ func TestRunMain(t *testing.T) {
main()
}
}
<<<<<<< HEAD
=======

func TestT(t *testing.T) {
TestingT(t)
}

var _ = Suite(&testMainSuite{})

type testMainSuite struct{}

func (t *testMainSuite) TestSetGlobalVars(c *C) {
c.Assert(variable.SysVars[variable.TiDBIsolationReadEngines].Value, Equals, "tikv, tiflash, tidb")
c.Assert(variable.SysVars[variable.TIDBMemQuotaQuery].Value, Equals, "1073741824")

config.GetGlobalConfig().IsolationRead.Engines = []string{"tikv", "tidb"}
config.GetGlobalConfig().MemQuotaQuery = 9999999
setGlobalVars()

c.Assert(variable.SysVars[variable.TiDBIsolationReadEngines].Value, Equals, "tikv, tidb")
c.Assert(variable.SysVars[variable.TIDBMemQuotaQuery].Value, Equals, "9999999")
}
>>>>>>> 39cc893... session: fix unseccessfully isolation read engines init session (#16465)