Skip to content

Commit

Permalink
sem: add tidbredact log to restricted variables (#24701)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgo committed May 18, 2021
1 parent fbbf2b4 commit b515e14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/sem/sem.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func IsInvisibleSysVar(varNameInLower string) bool {
variable.TiDBCheckMb4ValueInUTF8,
variable.TiDBConfig,
variable.TiDBEnableSlowLog,
variable.TiDBEnableTelemetry,
variable.TiDBExpensiveQueryTimeThreshold,
variable.TiDBForcePriority,
variable.TiDBGeneralLog,
Expand All @@ -146,12 +147,13 @@ func IsInvisibleSysVar(varNameInLower string) bool {
variable.TiDBOptWriteRowID,
variable.TiDBPProfSQLCPU,
variable.TiDBRecordPlanInSlowLog,
variable.TiDBRowFormatVersion,
variable.TiDBSlowQueryFile,
variable.TiDBSlowLogThreshold,
variable.TiDBEnableCollectExecutionInfo,
variable.TiDBMemoryUsageAlarmRatio,
variable.TiDBEnableTelemetry,
variable.TiDBRowFormatVersion:
variable.TiDBRedactLog,
variable.TiDBSlowLogMasking:
return true
}
return false
Expand Down
2 changes: 2 additions & 0 deletions util/sem/sem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ func (s *testSecurity) TestIsInvisibleSysVar(c *C) {
c.Assert(IsInvisibleSysVar(variable.TiDBMemoryUsageAlarmRatio), IsTrue)
c.Assert(IsInvisibleSysVar(variable.TiDBEnableTelemetry), IsTrue)
c.Assert(IsInvisibleSysVar(variable.TiDBRowFormatVersion), IsTrue)
c.Assert(IsInvisibleSysVar(variable.TiDBRedactLog), IsTrue)
c.Assert(IsInvisibleSysVar(variable.TiDBSlowLogMasking), IsTrue)
}

0 comments on commit b515e14

Please sign in to comment.