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

sysvar: allow modifying 'tidb_allow_remove_auto_inc' when SEM is ON #40083

Merged
merged 5 commits into from
Dec 21, 2022
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
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