Skip to content

Commit ace866f

Browse files
committed
sql: remove deprecated cols from crdb_internal.jobs, SHOW
The 'stated' column in SHOW JOBS just duplicated the value of returned in the 'created' column. The removed columns in the internal table were always populated with fixed null placeholders since 25.1. Release note (sql change): the 'started' column in SHOW JOBS, which was just a duplicate of the 'created' column, has been removed. Epic: none.
1 parent b3ee921 commit ace866f

File tree

5 files changed

+4
-25
lines changed

5 files changed

+4
-25
lines changed

pkg/cli/zip_table_registry.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,25 +382,21 @@ var zipInternalTablesPerCluster = DebugZipTableRegistry{
382382
},
383383
// `statement` column can contain customer URI params such as
384384
// AWS_ACCESS_KEY_ID.
385-
// `error`, `execution_errors`, and `execution_events` columns contain
386-
// error text that may contain sensitive data.
385+
// `error` column contains error text that may contain sensitive data.
387386
"crdb_internal.jobs": {
388387
nonSensitiveCols: NonSensitiveColumns{
389388
"job_id",
390389
"job_type",
391390
"description",
392391
"user_name",
393-
"descriptor_ids",
394392
"status",
395393
"running_status",
396394
"created",
397-
"started",
398395
"finished",
399396
"modified",
400397
"fraction_completed",
401398
"high_water_timestamp",
402399
"coordinator_id",
403-
"trace_id",
404400
},
405401
},
406402
"crdb_internal.system_jobs": {

pkg/server/admin.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,6 @@ SELECT
22712271
fraction_completed,
22722272
high_water_timestamp,
22732273
error,
2274-
execution_events::string,
22752274
coordinator_id
22762275
FROM crdb_internal.jobs
22772276
WHERE true`) // Simplifies filter construction below.
@@ -2368,7 +2367,6 @@ func scanRowIntoJob(scanner resultScanner, row tree.Datums, job *serverpb.JobRes
23682367
var fractionCompletedOrNil *float32
23692368
var highwaterOrNil *apd.Decimal
23702369
var runningStatusOrNil *string
2371-
var executionFailuresOrNil *string
23722370
var coordinatorOrNil *int64
23732371
if err := scanner.ScanAll(
23742372
row,
@@ -2385,7 +2383,6 @@ func scanRowIntoJob(scanner resultScanner, row tree.Datums, job *serverpb.JobRes
23852383
&fractionCompletedOrNil,
23862384
&highwaterOrNil,
23872385
&job.Error,
2388-
&executionFailuresOrNil,
23892386
&coordinatorOrNil,
23902387
); err != nil {
23912388
return errors.Wrap(err, "scan")
@@ -2438,7 +2435,7 @@ func jobHelper(
24382435
const query = `
24392436
SELECT job_id, job_type, description, statement, user_name, status,
24402437
running_status, created, finished, modified,
2441-
fraction_completed, high_water_timestamp, error, execution_events::string, coordinator_id
2438+
fraction_completed, high_water_timestamp, error, coordinator_id
24422439
FROM crdb_internal.jobs
24432440
WHERE job_id = $1`
24442441
row, cols, err := sqlServer.internalExecutor.QueryRowExWithCols(

pkg/sql/crdb_internal.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,20 +1152,15 @@ CREATE TABLE crdb_internal.jobs (
11521152
description STRING,
11531153
statement STRING,
11541154
user_name STRING,
1155-
descriptor_ids INT[],
11561155
status STRING,
11571156
running_status STRING,
11581157
created TIMESTAMPTZ,
1159-
started TIMESTAMPTZ,
11601158
finished TIMESTAMPTZ,
11611159
modified TIMESTAMPTZ,
11621160
fraction_completed FLOAT,
11631161
high_water_timestamp DECIMAL,
11641162
error STRING,
11651163
coordinator_id INT,
1166-
trace_id INT,
1167-
execution_errors STRING[],
1168-
execution_events JSONB,
11691164
INDEX(job_id),
11701165
INDEX(status),
11711166
INDEX(job_type)
@@ -1347,20 +1342,15 @@ LEFT OUTER JOIN system.public.job_status AS s ON j.id = s.job_id
13471342
desc,
13481343
desc,
13491344
ownerStr,
1350-
tree.DNull, // deperecated "descriptor_ids"
13511345
state,
13521346
status,
13531347
created,
1354-
created, // deprecated "started" field.
13551348
finished,
13561349
modified,
13571350
fraction,
13581351
resolved,
13591352
errorMsg,
13601353
instanceID,
1361-
tree.DNull, // deprecated "trace_id" field.
1362-
tree.DNull, // deprecated "executionErrors" field.
1363-
tree.DNull, // deprecated "executionEvents" field.
13641354
); err != nil {
13651355
return emitted, err
13661356
}

pkg/sql/delegate/show_changefeed_jobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SELECT
3737
status,
3838
running_status,
3939
created,
40-
started,
40+
created as started,
4141
finished,
4242
modified,
4343
high_water_timestamp,

pkg/sql/delegate/show_jobs.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,10 @@ func constructSelectQuery(n *tree.ShowJobs) string {
2828
baseQuery.WriteString(`description, statement, `)
2929
}
3030
baseQuery.WriteString(`user_name, status, running_status, `)
31-
baseQuery.WriteString(`date_trunc('second', created) as created, date_trunc('second', started) as started, `)
31+
baseQuery.WriteString(`date_trunc('second', created) as created, date_trunc('second', created) as started, `)
3232
baseQuery.WriteString(`date_trunc('second', finished) as finished, date_trunc('second', modified) as modified, `)
3333
baseQuery.WriteString(`fraction_completed, error, coordinator_id`)
3434

35-
if n.Jobs != nil {
36-
baseQuery.WriteString(`, trace_id, execution_errors`)
37-
}
38-
3935
// Check if there are any SHOW JOBS options that we need to add columns for.
4036
if n.Options != nil {
4137
if n.Options.ExecutionDetails {

0 commit comments

Comments
 (0)