Skip to content

Commit e8d9cfd

Browse files
craig[bot]bghal
andcommitted
Merge #153051
153051: sql: followup on inspect errors table r=bghal a=bghal Making some minor changes that came up after a previous PR was merged. Fixes: #151821 Epic: CRDB-30356 Release note: None Co-authored-by: Brendan Gerrity <[email protected]>
2 parents a78d085 + 5e03c90 commit e8d9cfd

File tree

8 files changed

+40
-35
lines changed

8 files changed

+40
-35
lines changed

pkg/sql/catalog/bootstrap/testdata/testdata

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

pkg/sql/catalog/systemschema/system.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,15 +1333,16 @@ CREATE TABLE public.inspect_errors (
13331333
error_id UUID DEFAULT gen_random_uuid(),
13341334
job_id INT8 NOT NULL,
13351335
error_type STRING NOT NULL,
1336+
aost TIMESTAMPTZ NOT NULL,
13361337
database_id OID NULL,
13371338
schema_id OID NULL,
13381339
id OID NOT NULL,
13391340
primary_key STRING NULL,
1340-
details STRING NOT NULL,
1341+
details JSONB NOT NULL,
13411342
crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '90 days':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '90 days':::INTERVAL,
13421343
CONSTRAINT "primary" PRIMARY KEY (error_id ASC),
13431344
INDEX object_idx (id ASC),
1344-
FAMILY "primary" (error_id, job_id, error_type, database_id, schema_id, id, primary_key, details, crdb_internal_expiration)
1345+
FAMILY "primary" (error_id, job_id, error_type, aost, database_id, schema_id, id, primary_key, details, crdb_internal_expiration)
13451346
) WITH (ttl_expire_after = '90 days');`
13461347
)
13471348

@@ -5240,19 +5241,20 @@ var (
52405241
{Name: "error_id", ID: 1, Type: types.Uuid, DefaultExpr: &genRandomUUIDString},
52415242
{Name: "job_id", ID: 2, Type: types.Int},
52425243
{Name: "error_type", ID: 3, Type: types.String},
5243-
{Name: "database_id", ID: 4, Type: types.Oid, Nullable: true},
5244-
{Name: "schema_id", ID: 5, Type: types.Oid, Nullable: true},
5245-
{Name: "id", ID: 6, Type: types.Oid},
5246-
{Name: "primary_key", ID: 7, Type: types.String, Nullable: true},
5247-
{Name: "details", ID: 8, Type: types.String},
5248-
{Name: "crdb_internal_expiration", ID: 9, Type: types.TimestampTZ, DefaultExpr: &inspectErrorsExpirationString, OnUpdateExpr: &inspectErrorsExpirationString, Hidden: true},
5244+
{Name: "aost", ID: 4, Type: types.TimestampTZ},
5245+
{Name: "database_id", ID: 5, Type: types.Oid, Nullable: true},
5246+
{Name: "schema_id", ID: 6, Type: types.Oid, Nullable: true},
5247+
{Name: "id", ID: 7, Type: types.Oid},
5248+
{Name: "primary_key", ID: 8, Type: types.String, Nullable: true},
5249+
{Name: "details", ID: 9, Type: types.Jsonb},
5250+
{Name: "crdb_internal_expiration", ID: 10, Type: types.TimestampTZ, DefaultExpr: &inspectErrorsExpirationString, OnUpdateExpr: &inspectErrorsExpirationString, Hidden: true},
52495251
},
52505252
[]descpb.ColumnFamilyDescriptor{
52515253
{
52525254

52535255
Name: "primary",
5254-
ColumnNames: []string{"error_id", "job_id", "error_type", "database_id", "schema_id", "id", "primary_key", "details", "crdb_internal_expiration"},
5255-
ColumnIDs: []descpb.ColumnID{1, 2, 3, 4, 5, 6, 7, 8, 9},
5256+
ColumnNames: []string{"error_id", "job_id", "error_type", "aost", "database_id", "schema_id", "id", "primary_key", "details", "crdb_internal_expiration"},
5257+
ColumnIDs: []descpb.ColumnID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
52565258
},
52575259
},
52585260
descpb.IndexDescriptor{
@@ -5270,7 +5272,7 @@ var (
52705272
Version: descpb.StrictIndexColumnIDGuaranteesVersion,
52715273
KeyColumnNames: []string{"id"},
52725274
KeyColumnDirections: singleASC,
5273-
KeyColumnIDs: []descpb.ColumnID{6},
5275+
KeyColumnIDs: []descpb.ColumnID{7},
52745276
KeySuffixColumnIDs: []descpb.ColumnID{1},
52755277
},
52765278
),

pkg/sql/catalog/systemschema_test/testdata/bootstrap_system

Lines changed: 5 additions & 4 deletions
Large diffs are not rendered by default.

pkg/sql/catalog/systemschema_test/testdata/bootstrap_tenant

Lines changed: 5 additions & 4 deletions
Large diffs are not rendered by default.

pkg/sql/logictest/testdata/logic_test/gen_test_objects

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,15 @@ ORDER BY table_name, column_name
199199
LIMIT 20
200200
----
201201
"insp""ect_err""ors" "error_id" uuid
202-
"insp""ect_err""ors" "databas😩e_!id😝" oid
203-
"insp""ect_err""ors" details text
202+
"insp""ect_err""ors" "a%vost" timestamp with time zone
203+
"insp""ect_err""ors" "daTa""baSe_id" oid
204+
"insp""ect_err""ors" details jsonb
204205
"insp""ect_err""ors" er_ror_type text
205-
"insp""ect_err""ors" "id \v" oid
206+
"insp""ect_err""ors" id oid
206207
"insp""ect_err""ors" "j%vob_id͐" bigint
207208
"insp""ect_err""ors" primary_key text
208209
"insp""ect_err""ors" rowid bigint
209-
"insp""ect_err""ors" schema_id oid
210+
"insp""ect_err""ors" "schema_%q\vid" oid
210211
jobs claim_instance_id bigint
211212
jobs claim_session_id bytea
212213
jobs "cre\\xa7a%6bted_b,y_type" text
@@ -217,7 +218,6 @@ jobs error_msg text
217218
jobs "finiShed" timestamp with time zone
218219
jobs id bigint
219220
jobs "job._type" text
220-
jobs "la%55st_run" timestamp without time zone
221221

222222
subtest templates/different_templates_in_each_db
223223

pkg/sql/logictest/testdata/logic_test/information_schema

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,9 @@ system public 29_72_6_not_null
15691569
system public 29_73_1_not_null error_id IS NOT NULL
15701570
system public 29_73_2_not_null job_id IS NOT NULL
15711571
system public 29_73_3_not_null error_type IS NOT NULL
1572-
system public 29_73_6_not_null id IS NOT NULL
1573-
system public 29_73_8_not_null details IS NOT NULL
1572+
system public 29_73_4_not_null aost IS NOT NULL
1573+
system public 29_73_7_not_null id IS NOT NULL
1574+
system public 29_73_9_not_null details IS NOT NULL
15741575
system public 29_7_1_not_null value IS NOT NULL
15751576
system public 29_8_1_not_null id IS NOT NULL
15761577
system public 29_9_1_not_null crdb_region IS NOT NULL
@@ -1895,8 +1896,9 @@ system public 29_72_6_not_null
18951896
system public 29_73_1_not_null error_id IS NOT NULL
18961897
system public 29_73_2_not_null job_id IS NOT NULL
18971898
system public 29_73_3_not_null error_type IS NOT NULL
1898-
system public 29_73_6_not_null id IS NOT NULL
1899-
system public 29_73_8_not_null details IS NOT NULL
1899+
system public 29_73_4_not_null aost IS NOT NULL
1900+
system public 29_73_7_not_null id IS NOT NULL
1901+
system public 29_73_9_not_null details IS NOT NULL
19001902
system public 29_7_1_not_null value IS NOT NULL
19011903
system public 29_8_1_not_null id IS NOT NULL
19021904
system public 29_9_1_not_null crdb_region IS NOT NULL

pkg/sql/logictest/testdata/logic_test/pg_catalog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ indexrelid indrelid indnatts indisunique indnullsnotdistinct indisprimary
11531153
710236230 58 1 true false true false true false true false false true false 1 0 0 2 NULL NULL 1
11541154
803027558 26 3 true false true false true false true false false true false 1 2 3 0 0 3403232968 0 0 0 2 2 2 NULL NULL 3
11551155
830785509 73 1 true false true false true false true false false true false 1 0 0 2 NULL NULL 1
1156-
830785510 73 1 false false false false false false true false false true false 6 0 0 2 NULL NULL 1
1156+
830785510 73 1 false false false false false false true false false true false 7 0 0 2 NULL NULL 1
11571157
923576837 41 1 true false true false true false true false false true false 1 0 0 2 NULL NULL 1
11581158
969972501 57 1 true false true false true false true false false true false 1 0 0 2 NULL NULL 1
11591159
969972502 57 1 true false false false true false true false false true false 2 0 0 2 NULL NULL 1

pkg/upgrade/upgrades/v25_4_inspect_errors_table.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import (
1414
"github.com/cockroachdb/cockroach/pkg/upgrade"
1515
)
1616

17-
// createInspectErrorsTable creates the prepared_transactions system
18-
// table.
17+
// createInspectErrorsTable creates the inspect_errors system table.
1918
func createInspectErrorsTable(
2019
ctx context.Context, cv clusterversion.ClusterVersion, d upgrade.TenantDeps,
2120
) error {

0 commit comments

Comments
 (0)