Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf committed Nov 24, 2022
1 parent e97d7d3 commit 9b7e323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions sessionctx/variable/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ var noopSysVars = []*SysVar{
{Scope: ScopeNone, Name: "innodb_log_group_home_dir", Value: "./"},
{Scope: ScopeNone, Name: "performance_schema_events_statements_history_size", Value: "10"},
{Scope: ScopeGlobal, Name: GeneralLog, Value: Off, Type: TypeBool},
{Scope: ScopeGlobal, Name: "validate_password_dictionary_file", Value: ""},
{Scope: ScopeGlobal, Name: BinlogOrderCommits, Value: On, Type: TypeBool},
{Scope: ScopeGlobal, Name: "key_cache_division_limit", Value: "100"},
{Scope: ScopeGlobal | ScopeSession, Name: "max_insert_delayed_threads", Value: "20"},
Expand Down
10 changes: 5 additions & 5 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ var defaultSysVars = []*SysVar{
PasswordValidationLength.Store(int32(TidbOptInt64(val, 8)))
return nil
}, GetGlobal: func(_ context.Context, s *SessionVars) (string, error) {
return fmt.Sprintf("%d", PasswordValidationLength.Load()), nil
return strconv.FormatInt(int64(PasswordValidationLength.Load()), 10), nil
},
},
{Scope: ScopeGlobal, Name: ValidatePasswordMixedCaseCount, Value: "1", Type: TypeInt, MinValue: 0, MaxValue: math.MaxInt32,
Expand All @@ -524,7 +524,7 @@ var defaultSysVars = []*SysVar{
PasswordValidationMixedCaseCount.Store(int32(TidbOptInt64(val, 1)))
return nil
}, GetGlobal: func(_ context.Context, s *SessionVars) (string, error) {
return fmt.Sprintf("%d", PasswordValidationMixedCaseCount.Load()), nil
return strconv.FormatInt(int64(PasswordValidationMixedCaseCount.Load()), 10), nil
},
},
{Scope: ScopeGlobal, Name: ValidatePasswordNumberCount, Value: "1", Type: TypeInt, MinValue: 0, MaxValue: math.MaxInt32,
Expand All @@ -543,7 +543,7 @@ var defaultSysVars = []*SysVar{
PasswordValidtaionNumberCount.Store(int32(TidbOptInt64(val, 1)))
return nil
}, GetGlobal: func(_ context.Context, s *SessionVars) (string, error) {
return fmt.Sprintf("%d", PasswordValidtaionNumberCount.Load()), nil
return strconv.FormatInt(int64(PasswordValidtaionNumberCount.Load()), 10), nil
},
},
{Scope: ScopeGlobal, Name: ValidatePasswordSpecialCharCount, Value: "1", Type: TypeInt, MinValue: 0, MaxValue: math.MaxInt32,
Expand All @@ -562,7 +562,7 @@ var defaultSysVars = []*SysVar{
PasswordValidationSpecialCharCount.Store(int32(TidbOptInt64(val, 1)))
return nil
}, GetGlobal: func(_ context.Context, s *SessionVars) (string, error) {
return fmt.Sprintf("%d", PasswordValidationSpecialCharCount.Load()), nil
return strconv.FormatInt(int64(PasswordValidationSpecialCharCount.Load()), 10), nil
},
},
{Scope: ScopeGlobal, Name: ValidatePasswordDictionary, Value: "", Type: TypeStr},
Expand Down Expand Up @@ -1127,7 +1127,7 @@ var defaultSysVars = []*SysVar{
MemoryUsageAlarmKeepRecordNum.Store(TidbOptInt64(val, DefMemoryUsageAlarmKeepRecordNum))
return nil
}, GetGlobal: func(_ context.Context, s *SessionVars) (string, error) {
return fmt.Sprintf("%d", MemoryUsageAlarmKeepRecordNum.Load()), nil
return strconv.FormatInt(MemoryUsageAlarmKeepRecordNum.Load(), 10), nil
}},

/* The system variables below have GLOBAL and SESSION scope */
Expand Down

0 comments on commit 9b7e323

Please sign in to comment.