diff --git a/pkg/jobs/jobs.go b/pkg/jobs/jobs.go index a51cb3cd70e8..f4ea23794382 100644 --- a/pkg/jobs/jobs.go +++ b/pkg/jobs/jobs.go @@ -162,17 +162,20 @@ func init() { // Status represents the status of a job in the system.jobs table. type Status string -// SafeFormat implements redact.SafeFormatter. -func (s Status) SafeFormat(sp redact.SafePrinter, verb rune) { - sp.SafeString(redact.SafeString(s)) -} +// SafeValue implements redact.SafeValue. +func (s Status) SafeValue() {} -var _ redact.SafeFormatter = Status("") +var _ redact.SafeValue = Status("") // RunningStatus represents the more detailed status of a running job in // the system.jobs table. type RunningStatus string +// SafeValue implements redact.SafeValue. +func (s RunningStatus) SafeValue() {} + +var _ redact.SafeValue = RunningStatus("") + const ( // StatusPending is `for jobs that have been created but on which work has // not yet started. diff --git a/pkg/sql/logictest/testdata/logic_test/jobs b/pkg/sql/logictest/testdata/logic_test/jobs index 183101b56cdc..93cda6a61f6b 100644 --- a/pkg/sql/logictest/testdata/logic_test/jobs +++ b/pkg/sql/logictest/testdata/logic_test/jobs @@ -270,12 +270,17 @@ SELECT count(*) FROM [SHOW AUTOMATIC JOBS] WHERE job_type = 'POLL JOBS STATS' AN subtest control_job_priv -skip 125212 - user testuser statement ok -CREATE TABLE t_control_job_priv(x INT); +CREATE TABLE t_control_job_priv(x INT) + +# Add a row into the table so that the GC job does not complete immediately; +# it must wait for the table data gc.ttl before removing the descriptor. +statement ok +INSERT INTO t_control_job_priv VALUES (1) + +statement ok DROP TABLE t_control_job_priv let $job_id @@ -303,12 +308,17 @@ subtest end subtest control_job_priv_inherited -skip 125212 - user testuser statement ok -CREATE TABLE t_control_job_priv_inherited(x INT); +CREATE TABLE t_control_job_priv_inherited(x INT) + +# Add a row into the table so that the GC job does not complete immediately; +# it must wait for the table data gc.ttl before removing the descriptor. +statement ok +INSERT INTO t_control_job_priv_inherited VALUES (1) + +statement ok DROP TABLE t_control_job_priv_inherited let $job_id diff --git a/pkg/testutils/lint/passes/redactcheck/redactcheck.go b/pkg/testutils/lint/passes/redactcheck/redactcheck.go index 5259593345cf..acae5117ab77 100644 --- a/pkg/testutils/lint/passes/redactcheck/redactcheck.go +++ b/pkg/testutils/lint/passes/redactcheck/redactcheck.go @@ -75,6 +75,10 @@ func runAnalyzer(pass *analysis.Pass) (interface{}, error) { "sz": {}, "timing": {}, }, + "github.com/cockroachdb/cockroach/pkg/jobs": { + "RunningStatus": {}, + "Status": {}, + }, "github.com/cockroachdb/cockroach/pkg/jobs/jobspb": { "Type": {}, },