Skip to content

Commit

Permalink
*: tiny update
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala committed Sep 10, 2024
1 parent ca05911 commit ed0c7a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,10 @@ func (d *ddl) SwitchMDL(enable bool) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
defer cancel()

logutil.BgLogger().Info(fmt.Sprintf("xxx---------------- 000 mdl:%v, concurrent:%v", enable, variable.DefTiDBEnableConcurrentDDL))
// Disable MDL for test.
if enable && !variable.DefTiDBEnableConcurrentDDL {
logutil.BgLogger().Info("xxx---------------- 111 mdl")
sql := fmt.Sprintf("UPDATE HIGH_PRIORITY %[1]s.%[2]s SET VARIABLE_VALUE = %[4]d WHERE VARIABLE_NAME = '%[3]s'",
mysql.SystemDB, mysql.GlobalVariablesTable, variable.TiDBEnableMDL, 0)
sess, err := d.sessPool.get()
Expand Down
3 changes: 3 additions & 0 deletions server/tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3325,6 +3325,9 @@ func TestAuthSocket(t *testing.T) {
}

func TestIssue53634(t *testing.T) {
if !variable.DefTiDBEnableConcurrentDDL {
t.Logf("mdl defConcurrent:%v", variable.DefTiDBEnableConcurrentDDL)
}
cfg := newTestConfig()
cfg.Lease = "20s"
cfg.Port = 4123
Expand Down
1 change: 1 addition & 0 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ var defaultSysVars = []*SysVar{
return BoolToOnOff(EnableConcurrentDDL.Load()), nil
}},
{Scope: ScopeGlobal, Name: TiDBEnableMDL, Value: BoolToOnOff(DefTiDBEnableMDL), Type: TypeBool, SetGlobal: func(_ context.Context, vars *SessionVars, val string) error {
logutil.BgLogger().Info(fmt.Sprintf("xxx---------------- mdl previous:%v, set:%v", EnableMDL.Load(), val))
if EnableMDL.Load() != TiDBOptOn(val) {
err := SwitchMDL(TiDBOptOn(val))
if err != nil {
Expand Down

0 comments on commit ed0c7a9

Please sign in to comment.