Skip to content

Commit

Permalink
Merge branch 'master' into license-header
Browse files Browse the repository at this point in the history
  • Loading branch information
tisonkun committed Sep 17, 2021
2 parents beb2e8e + 74c507b commit 3b21212
Show file tree
Hide file tree
Showing 11 changed files with 335 additions and 300 deletions.
7 changes: 5 additions & 2 deletions distsql/request_builder_test.go
Expand Up @@ -528,6 +528,8 @@ func TestRequestBuilder7(t *testing.T) {
{kv.ReplicaReadFollower, "Follower"},
{kv.ReplicaReadMixed, "Mixed"},
} {
// copy iterator variable into a new variable, see issue #27779
replicaRead := replicaRead
t.Run(replicaRead.src, func(t *testing.T) {
t.Parallel()
vars := variable.NewSessionVars()
Expand Down Expand Up @@ -629,14 +631,15 @@ func TestScanLimitConcurrency(t *testing.T) {
tp tipb.ExecType
limit uint64
concurrency int

src string
src string
}{
{tipb.ExecType_TypeTableScan, 1, 1, "TblScan_Def"},
{tipb.ExecType_TypeIndexScan, 1, 1, "IdxScan_Def"},
{tipb.ExecType_TypeTableScan, 1000000, vars.Concurrency.DistSQLScanConcurrency(), "TblScan_SessionVars"},
{tipb.ExecType_TypeIndexScan, 1000000, vars.Concurrency.DistSQLScanConcurrency(), "IdxScan_SessionVars"},
} {
// copy iterator variable into a new variable, see issue #27779
tt := tt
t.Run(tt.src, func(t *testing.T) {
t.Parallel()
firstExec := &tipb.Executor{Tp: tt.tp}
Expand Down
3 changes: 2 additions & 1 deletion executor/executor_test.go
Expand Up @@ -5689,7 +5689,8 @@ func (s *testSuiteWithCliBaseCharset) TestCharsetFeature(c *C) {
tk.MustQuery("select @@character_set_connection;").Check(testkit.Rows("gbk"))
tk.MustQuery("select @@collation_connection;").Check(testkit.Rows("gbk_bin"))

tk.MustQuery("select _gbk 'a'").Check(testkit.Rows("a"))
// TODO: it will fail if update parser, comment it to prevent block CI. Will fix after https://github.com/pingcap/tidb/pull/27875 merged.
//tk.MustQuery("select _gbk 'a'").Check(testkit.Rows("a"))

tk.MustExec("use test")
tk.MustExec("create table t1(a char(10) charset gbk);")
Expand Down
2 changes: 2 additions & 0 deletions meta/meta_test.go
Expand Up @@ -473,6 +473,8 @@ func TestDDL(t *testing.T) {
}

for _, tc := range testCases {
// copy iterator variable into a new variable, see issue #27779
tc := tc
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
store, err := mockstore.NewMockStore()
Expand Down
2 changes: 2 additions & 0 deletions sessionctx/variable/session_test.go
Expand Up @@ -58,6 +58,8 @@ func TestSetSystemVariable(t *testing.T) {
}

for _, tc := range testCases {
// copy iterator variable into a new variable, see issue #27779
tc := tc
t.Run(tc.key, func(t *testing.T) {
t.Parallel()
mtx.Lock()
Expand Down
4 changes: 4 additions & 0 deletions sessionctx/variable/varsutil_test.go
Expand Up @@ -625,6 +625,8 @@ func TestValidate(t *testing.T) {
}

for _, tc := range testCases {
// copy iterator variable into a new variable, see issue #27779
tc := tc
t.Run(tc.key, func(t *testing.T) {
t.Parallel()
_, err := GetSysVar(tc.key).Validate(v, tc.value, ScopeSession)
Expand Down Expand Up @@ -682,6 +684,8 @@ func TestValidateStmtSummary(t *testing.T) {
}

for _, tc := range testCases {
// copy iterator variable into a new variable, see issue #27779
tc := tc
t.Run(tc.key, func(t *testing.T) {
t.Parallel()
_, err := GetSysVar(tc.key).Validate(v, tc.value, tc.scope)
Expand Down

0 comments on commit 3b21212

Please sign in to comment.