Skip to content

Commit

Permalink
sysvar: allow modifying 'tidb_allow_remove_auto_inc' when SEM is ON
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf committed Dec 21, 2022
1 parent 51cce45 commit d97ac82
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sessionctx/sessionstates/session_states_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestSystemVars(t *testing.T) {
{
// sem invisible variable
inSessionStates: false,
varName: variable.TiDBAllowRemoveAutoInc,
varName: variable.TiDBConfig,
},
{
// noop variables
Expand Down
1 change: 0 additions & 1 deletion util/sem/sem.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func IsInvisibleStatusVar(varName string) bool {
func IsInvisibleSysVar(varNameInLower string) bool {
switch varNameInLower {
case variable.TiDBDDLSlowOprThreshold, // ddl_slow_threshold
variable.TiDBAllowRemoveAutoInc,
variable.TiDBCheckMb4ValueInUTF8,
variable.TiDBConfig,
variable.TiDBEnableSlowLog,
Expand Down
2 changes: 1 addition & 1 deletion util/sem/sem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func TestIsInvisibleSysVar(t *testing.T) {

assert.False(IsInvisibleSysVar(variable.Hostname)) // changes the value to default, but is not invisible
assert.False(IsInvisibleSysVar(variable.TiDBEnableEnhancedSecurity)) // should be able to see the mode is on.
assert.False(IsInvisibleSysVar(variable.TiDBAllowRemoveAutoInc))

assert.True(IsInvisibleSysVar(variable.TiDBAllowRemoveAutoInc))
assert.True(IsInvisibleSysVar(variable.TiDBCheckMb4ValueInUTF8))
assert.True(IsInvisibleSysVar(variable.TiDBConfig))
assert.True(IsInvisibleSysVar(variable.TiDBEnableSlowLog))
Expand Down

0 comments on commit d97ac82

Please sign in to comment.