From 32dfdc5bf4e3d4bb81801c02086803a142e8741a Mon Sep 17 00:00:00 2001 From: Morgan Tocker Date: Mon, 17 May 2021 18:23:42 -0600 Subject: [PATCH] sem: add tidbredact log to restricted variables --- util/sem/sem.go | 6 ++++-- util/sem/sem_test.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/util/sem/sem.go b/util/sem/sem.go index d29d29b601559..1aac6d0a9a999 100644 --- a/util/sem/sem.go +++ b/util/sem/sem.go @@ -138,6 +138,7 @@ func IsInvisibleSysVar(varNameInLower string) bool { variable.TiDBCheckMb4ValueInUTF8, variable.TiDBConfig, variable.TiDBEnableSlowLog, + variable.TiDBEnableTelemetry, variable.TiDBExpensiveQueryTimeThreshold, variable.TiDBForcePriority, variable.TiDBGeneralLog, @@ -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 diff --git a/util/sem/sem_test.go b/util/sem/sem_test.go index 073a195139c37..c2a54170dcf99 100644 --- a/util/sem/sem_test.go +++ b/util/sem/sem_test.go @@ -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) }