diff --git a/pkg/ccl/changefeedccl/BUILD.bazel b/pkg/ccl/changefeedccl/BUILD.bazel index f5d885cb800b..7481cd56eac6 100644 --- a/pkg/ccl/changefeedccl/BUILD.bazel +++ b/pkg/ccl/changefeedccl/BUILD.bazel @@ -277,6 +277,7 @@ go_test( "//pkg/sql/sem/tree", "//pkg/sql/sem/volatility", "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", "//pkg/sql/tests", "//pkg/sql/types", "//pkg/storage", diff --git a/pkg/ccl/logictestccl/testdata/logic_test/redact_descriptor b/pkg/ccl/logictestccl/testdata/logic_test/redact_descriptor index 23796567a905..1bd9b6068a35 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/redact_descriptor +++ b/pkg/ccl/logictestccl/testdata/logic_test/redact_descriptor @@ -75,7 +75,6 @@ SELECT descriptor from redacted_descriptors where id = 'collate_partition'::REGC "id": 2, "name": "b", "nullable": true, - "pgAttributeNum": 2, "type": { "family": "StringFamily", "oid": 25 diff --git a/pkg/ccl/schemachangerccl/testdata/decomp/multiregion b/pkg/ccl/schemachangerccl/testdata/decomp/multiregion index fdd13b3891cf..0089e15f8a71 100644 --- a/pkg/ccl/schemachangerccl/testdata/decomp/multiregion +++ b/pkg/ccl/schemachangerccl/testdata/decomp/multiregion @@ -88,7 +88,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 110 Status: PUBLIC - Column: @@ -98,7 +98,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 110 Status: PUBLIC - Column: @@ -108,7 +108,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 110 Status: PUBLIC - Column: @@ -118,7 +118,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 110 Status: PUBLIC - PrimaryIndex: @@ -365,7 +365,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - Column: @@ -375,7 +375,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - Column: @@ -385,7 +385,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - Column: @@ -395,7 +395,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - PrimaryIndex: @@ -644,7 +644,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -654,7 +654,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -664,7 +664,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: false - pgAttributeNum: 3 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -674,7 +674,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -684,7 +684,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/ccl/schemachangerccl/testdata/decomp/partitioning b/pkg/ccl/schemachangerccl/testdata/decomp/partitioning index 668a8a585458..d56a91a782b3 100644 --- a/pkg/ccl/schemachangerccl/testdata/decomp/partitioning +++ b/pkg/ccl/schemachangerccl/testdata/decomp/partitioning @@ -45,7 +45,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -55,7 +55,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -65,7 +65,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 3 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -75,7 +75,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -85,7 +85,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - PrimaryIndex: @@ -468,7 +468,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -478,7 +478,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -488,7 +488,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -498,7 +498,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/logictest/testdata/logic_test/expression_index b/pkg/sql/logictest/testdata/logic_test/expression_index index 21206bdf7746..2c0c28491558 100644 --- a/pkg/sql/logictest/testdata/logic_test/expression_index +++ b/pkg/sql/logictest/testdata/logic_test/expression_index @@ -267,7 +267,7 @@ SELECT * FROM ( ) AS desc FROM system.descriptor WHERE id = 't'::REGCLASS ) AS cols WHERE cols.desc->'name' = '"crdb_internal_idx_expr_2"' ---- -{"computeExpr": "a + 10:::INT8", "id": 9, "inaccessible": true, "name": "crdb_internal_idx_expr_2", "nullable": true, "pgAttributeNum": 9, "type": {"family": "IntFamily", "oid": 20, "width": 64}, "virtual": true} +{"computeExpr": "a + 10:::INT8", "id": 9, "inaccessible": true, "name": "crdb_internal_idx_expr_2", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}, "virtual": true} statement ok DROP INDEX t_lower_c_a_plus_b_idx @@ -284,8 +284,8 @@ SELECT * FROM ( ) AS desc FROM system.descriptor WHERE id = 't'::REGCLASS ) AS cols WHERE cols.desc->>'name' IN ('crdb_internal_idx_expr', 'crdb_internal_idx_expr_1') ---- -{"computeExpr": "a + b", "id": 7, "inaccessible": true, "name": "crdb_internal_idx_expr", "nullable": true, "pgAttributeNum": 7, "type": {"family": "IntFamily", "oid": 20, "width": 64}, "virtual": true} -{"computeExpr": "lower(c)", "id": 8, "inaccessible": true, "name": "crdb_internal_idx_expr_1", "nullable": true, "pgAttributeNum": 8, "type": {"family": "StringFamily", "oid": 25}, "virtual": true} +{"computeExpr": "a + b", "id": 7, "inaccessible": true, "name": "crdb_internal_idx_expr", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}, "virtual": true} +{"computeExpr": "lower(c)", "id": 8, "inaccessible": true, "name": "crdb_internal_idx_expr_1", "nullable": true, "type": {"family": "StringFamily", "oid": 25}, "virtual": true} onlyif config local-legacy-schema-changer query T diff --git a/pkg/sql/logictest/testdata/logic_test/materialized_view b/pkg/sql/logictest/testdata/logic_test/materialized_view index d7776090f288..8b34b9604b69 100644 --- a/pkg/sql/logictest/testdata/logic_test/materialized_view +++ b/pkg/sql/logictest/testdata/logic_test/materialized_view @@ -122,7 +122,7 @@ CREATE UNIQUE INDEX i ON v_dup (x); statement ok INSERT INTO dup VALUES (1), (1); -statement error pq: duplicate key value violates unique constraint "i"\nDETAIL: Key \(x\)=\(1\) already exists\. +statement error (duplicate key value violates unique constraint "i"\nDETAIL: Key \(x\)=\(1\) already exists\.|ingested key collides with an existing one) REFRESH MATERIALIZED VIEW v_dup # We shouldn't be able to mix materialized and non materialized views in DDLs. diff --git a/pkg/sql/opt/exec/execbuilder/testdata/show_trace b/pkg/sql/opt/exec/execbuilder/testdata/show_trace index 1843b0c86c84..6982e48340d1 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/show_trace +++ b/pkg/sql/opt/exec/execbuilder/testdata/show_trace @@ -165,7 +165,7 @@ query TT $trace_query ---- sql query rows affected: 0 -commit sql txn CPut /Table/3/1/109/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false invisibility:0 > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:PUBLIC current_statuses:PUBLIC target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 target_ranks:23 target_ranks:24 target_ranks:25 target_ranks:26 target_ranks:27 target_ranks:28 target_ranks:29 target_ranks:30 relevant_statements: > authorization: > drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 schema_locked:false > +commit sql txn CPut /Table/3/1/109/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false invisibility:0 > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:PUBLIC current_statuses:PUBLIC target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 target_ranks:23 target_ranks:24 target_ranks:25 target_ranks:26 target_ranks:27 target_ranks:28 target_ranks:29 target_ranks:30 relevant_statements: > authorization: > drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 schema_locked:false > commit sql txn Del /NamespaceTable/30/1/106/107/"kv2"/4/1 statement ok @@ -206,7 +206,7 @@ query TT $trace_query ---- sql query rows affected: 0 -commit sql txn CPut /Table/3/1/108/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false invisibility:0 > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:2 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:PUBLIC current_statuses:PUBLIC target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 target_ranks:23 target_ranks:24 target_ranks:25 relevant_statements: > authorization: > drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:4 import_start_wall_time:0 schema_locked:false > +commit sql txn CPut /Table/3/1/108/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false invisibility:0 > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:2 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true element_creation_metadata: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:PUBLIC current_statuses:PUBLIC target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 target_ranks:23 target_ranks:24 target_ranks:25 relevant_statements: > authorization: > drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:4 import_start_wall_time:0 schema_locked:false > commit sql txn Del /NamespaceTable/30/1/106/107/"kv"/4/1 # Check that session tracing does not inhibit the fast path for inserts & diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go index 6a82fb638a65..9f7bffc042ec 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go @@ -29,6 +29,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdecomp" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + "github.com/cockroachdb/cockroach/pkg/sql/sem/catid" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlerrors" "github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry" @@ -123,11 +124,14 @@ func alterTableAddColumn( IsHidden: desc.Hidden, IsInaccessible: desc.Inaccessible, GeneratedAsIdentityType: desc.GeneratedAsIdentityType, - PgAttributeNum: desc.GetPGAttributeNum(), }, unique: d.Unique.IsUnique, notNull: !desc.Nullable, } + // Only set PgAttributeNum if it differs from ColumnID. + if pgAttNum := desc.GetPGAttributeNum(); pgAttNum != catid.PGAttributeNum(desc.ID) { + spec.col.PgAttributeNum = pgAttNum + } if ptr := desc.GeneratedAsIdentitySequenceOption; ptr != nil { spec.col.GeneratedAsIdentitySequenceOption = *ptr } diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go index 173a3c6510c8..aaf4a8555d80 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go @@ -715,10 +715,9 @@ func maybeCreateAndAddShardCol( spec := addColumnSpec{ tbl: tbl, col: &scpb.Column{ - TableID: tbl.TableID, - ColumnID: shardColID, - IsHidden: true, - PgAttributeNum: catid.PGAttributeNum(shardColID), + TableID: tbl.TableID, + ColumnID: shardColID, + IsHidden: true, }, name: &scpb.ColumnName{ TableID: tbl.TableID, diff --git a/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_column b/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_column index de626e9abc89..5de56a935a8e 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_column +++ b/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_column @@ -6,7 +6,7 @@ build ALTER TABLE defaultdb.foo ADD COLUMN j INT ---- - [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] - {columnId: 2, pgAttributeNum: 2, tableId: 104} + {columnId: 2, tableId: 104} - [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, PUBLIC], ABSENT] {columnId: 2, name: j, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2}, PUBLIC], ABSENT] @@ -26,7 +26,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN j INT NOT NULL DEFAULT 123 - [[IndexData:{DescID: 104, IndexID: 1}, ABSENT], PUBLIC] {indexId: 1, tableId: 104} - [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] - {columnId: 2, pgAttributeNum: 2, tableId: 104} + {columnId: 2, tableId: 104} - [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, PUBLIC], ABSENT] {columnId: 2, name: j, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2}, PUBLIC], ABSENT] @@ -67,7 +67,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN k INT DEFAULT 456; - [[IndexData:{DescID: 104, IndexID: 1}, ABSENT], PUBLIC] {indexId: 1, tableId: 104} - [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] - {columnId: 2, pgAttributeNum: 2, tableId: 104} + {columnId: 2, tableId: 104} - [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, PUBLIC], ABSENT] {columnId: 2, name: j, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2}, PUBLIC], ABSENT] @@ -93,7 +93,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN k INT DEFAULT 456; - [[IndexData:{DescID: 104, IndexID: 3}, TRANSIENT_ABSENT], ABSENT] {indexId: 3, tableId: 104} - [[Column:{DescID: 104, ColumnID: 3}, PUBLIC], ABSENT] - {columnId: 3, pgAttributeNum: 3, tableId: 104} + {columnId: 3, tableId: 104} - [[ColumnName:{DescID: 104, Name: k, ColumnID: 3}, PUBLIC], ABSENT] {columnId: 3, name: k, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 3}, PUBLIC], ABSENT] @@ -117,7 +117,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN a INT AS (i+1) STORED - [[IndexData:{DescID: 104, IndexID: 1}, ABSENT], PUBLIC] {indexId: 1, tableId: 104} - [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] - {columnId: 2, pgAttributeNum: 2, tableId: 104} + {columnId: 2, tableId: 104} - [[ColumnName:{DescID: 104, Name: a, ColumnID: 2}, PUBLIC], ABSENT] {columnId: 2, name: a, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2}, PUBLIC], ABSENT] @@ -150,7 +150,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN a INT; ALTER TABLE defaultdb.bar ADD COLUMN b INT; ---- - [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] - {columnId: 2, pgAttributeNum: 2, tableId: 104} + {columnId: 2, tableId: 104} - [[ColumnName:{DescID: 104, Name: a, ColumnID: 2}, PUBLIC], ABSENT] {columnId: 2, name: a, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2}, PUBLIC], ABSENT] @@ -158,7 +158,7 @@ ALTER TABLE defaultdb.bar ADD COLUMN b INT; - [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1}, PUBLIC], ABSENT] {columnId: 2, indexId: 1, kind: STORED, tableId: 104} - [[Column:{DescID: 105, ColumnID: 3}, PUBLIC], ABSENT] - {columnId: 3, pgAttributeNum: 3, tableId: 105} + {columnId: 3, tableId: 105} - [[ColumnName:{DescID: 105, Name: b, ColumnID: 3}, PUBLIC], ABSENT] {columnId: 3, name: b, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 3}, PUBLIC], ABSENT] diff --git a/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_primary_key b/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_primary_key index 663b0541c2b8..823fcc3ee26e 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_primary_key +++ b/pkg/sql/schemachanger/scbuild/testdata/alter_table_add_primary_key @@ -7,7 +7,7 @@ build ALTER TABLE defaultdb.bar ADD PRIMARY KEY (i) ---- - [[Column:{DescID: 105, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, isHidden: true, pgAttributeNum: 2, tableId: 105} + {columnId: 2, isHidden: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: rowid, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: rowid, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/alter_table_alter_primary_key b/pkg/sql/schemachanger/scbuild/testdata/alter_table_alter_primary_key index 1fd5af94b3a6..3faf6f8d47f1 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/alter_table_alter_primary_key +++ b/pkg/sql/schemachanger/scbuild/testdata/alter_table_alter_primary_key @@ -67,7 +67,7 @@ build ALTER TABLE defaultdb.bar ALTER PRIMARY KEY USING COLUMNS (i) ---- - [[Column:{DescID: 105, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, isHidden: true, pgAttributeNum: 2, tableId: 105} + {columnId: 2, isHidden: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: rowid, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: rowid, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/alter_table_drop_column b/pkg/sql/schemachanger/scbuild/testdata/alter_table_drop_column index a6f1ea9a3b1e..d385424aebfa 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/alter_table_drop_column +++ b/pkg/sql/schemachanger/scbuild/testdata/alter_table_drop_column @@ -15,7 +15,7 @@ build ALTER TABLE defaultdb.t DROP COLUMN j ---- - [[Column:{DescID: 104, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 104} + {columnId: 2, tableId: 104} - [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: j, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] @@ -89,7 +89,7 @@ build ALTER TABLE defaultdb.t DROP COLUMN k, DROP COLUMN l ---- - [[Column:{DescID: 104, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 104} + {columnId: 3, tableId: 104} - [[ColumnName:{DescID: 104, Name: k, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: k, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] @@ -97,7 +97,7 @@ ALTER TABLE defaultdb.t DROP COLUMN k, DROP COLUMN l - [[ColumnNotNull:{DescID: 104, ColumnID: 3, IndexID: 0}, ABSENT], PUBLIC] {columnId: 3, tableId: 104} - [[Column:{DescID: 104, ColumnID: 4}, ABSENT], PUBLIC] - {columnId: 4, pgAttributeNum: 4, tableId: 104} + {columnId: 4, tableId: 104} - [[ColumnName:{DescID: 104, Name: l, ColumnID: 4}, ABSENT], PUBLIC] {columnId: 4, name: l, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] @@ -171,7 +171,7 @@ build ALTER TABLE defaultdb.t DROP COLUMN l ---- - [[Column:{DescID: 104, ColumnID: 4}, ABSENT], PUBLIC] - {columnId: 4, pgAttributeNum: 4, tableId: 104} + {columnId: 4, tableId: 104} - [[ColumnName:{DescID: 104, Name: l, ColumnID: 4}, ABSENT], PUBLIC] {columnId: 4, name: l, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/comment_on b/pkg/sql/schemachanger/scbuild/testdata/comment_on index 3a10654bb8dc..62b85a67e6bd 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/comment_on +++ b/pkg/sql/schemachanger/scbuild/testdata/comment_on @@ -86,7 +86,7 @@ build COMMENT ON COLUMN customer.name IS 'some comment for name'; ---- - [[ColumnComment:{DescID: 104, ColumnID: 2, Comment: some comment for name}, PUBLIC], ABSENT] - {columnId: 2, comment: some comment for name, pgAttributeNum: 2, tableId: 104} + {columnId: 2, comment: some comment for name, tableId: 104} setup COMMENT ON COLUMN customer.name IS 'real comment for name'; @@ -96,7 +96,7 @@ build COMMENT ON COLUMN customer.name IS 'some better comment for name'; ---- - [[ColumnComment:{DescID: 104, ColumnID: 2, Comment: some better comment for name}, PUBLIC], ABSENT] - {columnId: 2, comment: some better comment for name, pgAttributeNum: 2, tableId: 104} + {columnId: 2, comment: some better comment for name, tableId: 104} build COMMENT ON COLUMN customer.name IS NULL; diff --git a/pkg/sql/schemachanger/scbuild/testdata/create_index b/pkg/sql/schemachanger/scbuild/testdata/create_index index 70a6120a7844..1d4c2a6ed213 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/create_index +++ b/pkg/sql/schemachanger/scbuild/testdata/create_index @@ -89,7 +89,7 @@ CREATE INDEX id4 ON defaultdb.t1 (id, name) USING HASH STORING (money) WITH (bucket_count=8) ---- - [[Column:{DescID: 104, ColumnID: 4}, PUBLIC], ABSENT] - {columnId: 4, isHidden: true, pgAttributeNum: 4, tableId: 104} + {columnId: 4, isHidden: true, tableId: 104} - [[ColumnName:{DescID: 104, Name: crdb_internal_id_name_shard_8, ColumnID: 4}, PUBLIC], ABSENT] {columnId: 4, name: crdb_internal_id_name_shard_8, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4}, PUBLIC], ABSENT] diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_database b/pkg/sql/schemachanger/scbuild/testdata/drop_database index f3127a733fd7..55785bc2aa03 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_database +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_database @@ -96,7 +96,7 @@ DROP DATABASE db1 CASCADE - [[ColumnFamily:{DescID: 110, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 110} - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 110} + {columnId: 1, tableId: 110} - [[ColumnName:{DescID: 110, Name: id, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: id, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] @@ -104,13 +104,13 @@ DROP DATABASE db1 CASCADE - [[ColumnNotNull:{DescID: 110, ColumnID: 1, IndexID: 0}, ABSENT], PUBLIC] {columnId: 1, tableId: 110} - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 110} + {columnId: 2, tableId: 110} - [[ColumnName:{DescID: 110, Name: name, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: name, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 110} + {columnId: 3, tableId: 110} - [[ColumnName:{DescID: 110, Name: val, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: val, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] @@ -118,13 +118,13 @@ DROP DATABASE db1 CASCADE - [[ColumnDefaultExpression:{DescID: 110, ColumnID: 3, ReferencedSequenceIDs: [107]}, ABSENT], PUBLIC] {columnId: 3, expr: 'nextval(107:::REGCLASS)', tableId: 110, usesSequenceIds: [107]} - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 110} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 110} - [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 110} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 110} - [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -174,7 +174,7 @@ DROP DATABASE db1 CASCADE - [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 109} - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 109} + {columnId: 1, tableId: 109} - [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: id, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] @@ -184,13 +184,13 @@ DROP DATABASE db1 CASCADE - [[ColumnComment:{DescID: 109, ColumnID: 1, Comment: id is good}, ABSENT], PUBLIC] {columnId: 1, comment: id is good, pgAttributeNum: 1, tableId: 109} - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 109} + {columnId: 2, tableId: 109} - [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: name, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 109} + {columnId: 3, tableId: 109} - [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: val, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] @@ -198,13 +198,13 @@ DROP DATABASE db1 CASCADE - [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3, ReferencedSequenceIDs: [108]}, ABSENT], PUBLIC] {columnId: 3, expr: 'nextval(108:::REGCLASS)', tableId: 109, usesSequenceIds: [108]} - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 109} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 109} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -238,19 +238,19 @@ DROP DATABASE db1 CASCADE - [[SchemaChild:{DescID: 111, ReferencedDescID: 106}, ABSENT], PUBLIC] {childObjectId: 111, schemaId: 106} - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 111} + {columnId: 1, tableId: 111} - [[ColumnName:{DescID: 111, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 111} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 111} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -268,25 +268,25 @@ DROP DATABASE db1 CASCADE - [[SchemaChild:{DescID: 112, ReferencedDescID: 106}, ABSENT], PUBLIC] {childObjectId: 112, schemaId: 106} - [[Column:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 112} + {columnId: 1, tableId: 112} - [[ColumnName:{DescID: 112, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: n1, tableId: 112} - [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 112, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 112} + {columnId: 2, tableId: 112} - [[ColumnName:{DescID: 112, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 112} - [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 112, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 112, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 112} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 112} - [[ColumnName:{DescID: 112, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 112} - [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 112, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 112, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 112} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 112} - [[ColumnName:{DescID: 112, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 112} - [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -304,25 +304,25 @@ DROP DATABASE db1 CASCADE - [[SchemaChild:{DescID: 113, ReferencedDescID: 106}, ABSENT], PUBLIC] {childObjectId: 113, schemaId: 106} - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 113} + {columnId: 1, tableId: 113} - [[ColumnName:{DescID: 113, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 113, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 113} + {columnId: 2, tableId: 113} - [[ColumnName:{DescID: 113, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n1, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 113, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 113} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 113} - [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 113, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 113} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 113} - [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -340,25 +340,25 @@ DROP DATABASE db1 CASCADE - [[SchemaChild:{DescID: 114, ReferencedDescID: 106}, ABSENT], PUBLIC] {childObjectId: 114, schemaId: 106} - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 114} + {columnId: 1, tableId: 114} - [[ColumnName:{DescID: 114, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: n2, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 114} + {columnId: 2, tableId: 114} - [[ColumnName:{DescID: 114, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n1, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 114} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 114} - [[ColumnName:{DescID: 114, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 114} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 114} - [[ColumnName:{DescID: 114, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -406,31 +406,31 @@ DROP DATABASE db1 CASCADE - [[SchemaChild:{DescID: 117, ReferencedDescID: 106}, ABSENT], PUBLIC] {childObjectId: 117, schemaId: 106} - [[Column:{DescID: 117, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 117} + {columnId: 1, tableId: 117} - [[ColumnName:{DescID: 117, Name: k, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: k, tableId: 117} - [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 117, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 117, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 117} + {columnId: 2, tableId: 117} - [[ColumnName:{DescID: 117, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 117} - [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 117, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 117, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 117} + {columnId: 3, tableId: 117} - [[ColumnName:{DescID: 117, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: n1, tableId: 117} - [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 117, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 117, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 117} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 117} - [[ColumnName:{DescID: 117, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 117} - [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 117, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 117, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 117} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 117} - [[ColumnName:{DescID: 117, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 117} - [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_index b/pkg/sql/schemachanger/scbuild/testdata/drop_index index f26d55ba7973..f8fa79e30776 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_index +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_index @@ -32,7 +32,7 @@ build DROP INDEX idx2 CASCADE ---- - [[Column:{DescID: 104, ColumnID: 4}, ABSENT], PUBLIC] - {columnId: 4, isInaccessible: true, pgAttributeNum: 4, tableId: 104} + {columnId: 4, isInaccessible: true, tableId: 104} - [[ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4}, ABSENT], PUBLIC] {columnId: 4, name: crdb_internal_idx_expr, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] @@ -52,7 +52,7 @@ build DROP INDEX idx3 CASCADE ---- - [[Column:{DescID: 104, ColumnID: 5}, ABSENT], PUBLIC] - {columnId: 5, isHidden: true, pgAttributeNum: 5, tableId: 104} + {columnId: 5, isHidden: true, tableId: 104} - [[ColumnName:{DescID: 104, Name: crdb_internal_i_shard_16, ColumnID: 5}, ABSENT], PUBLIC] {columnId: 5, name: crdb_internal_i_shard_16, tableId: 104} - [[ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 5}, ABSENT], PUBLIC] @@ -88,19 +88,19 @@ DROP INDEX idx3 CASCADE - [[SchemaChild:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 105, schemaId: 101} - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 105} + {columnId: 1, tableId: 105} - [[ColumnName:{DescID: 105, Name: count, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: count, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 105, type: {family: IntFamily, oid: 20, width: 64}} - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 105} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 105, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 105} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -134,13 +134,13 @@ DROP INDEX v2@idx CASCADE - [[ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 107} - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 107} + {columnId: 1, tableId: 107} - [[ColumnName:{DescID: 107, Name: j, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: j, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, isHidden: true, pgAttributeNum: 2, tableId: 107} + {columnId: 2, isHidden: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: rowid, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: rowid, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] @@ -150,13 +150,13 @@ DROP INDEX v2@idx CASCADE - [[ColumnDefaultExpression:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, expr: unique_rowid(), tableId: 107} - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 107} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 107} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_owned_by b/pkg/sql/schemachanger/scbuild/testdata/drop_owned_by index 5ff828759825..5d3e88a8d843 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_owned_by @@ -63,7 +63,7 @@ DROP OWNED BY r - [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 109} - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 109} + {columnId: 1, tableId: 109} - [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: id, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] @@ -71,13 +71,13 @@ DROP OWNED BY r - [[ColumnNotNull:{DescID: 109, ColumnID: 1, IndexID: 0}, ABSENT], PUBLIC] {columnId: 1, tableId: 109} - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 109} + {columnId: 2, tableId: 109} - [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: name, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 109} + {columnId: 3, tableId: 109} - [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: val, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] @@ -85,13 +85,13 @@ DROP OWNED BY r - [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3, ReferencedSequenceIDs: [106]}, ABSENT], PUBLIC] {columnId: 3, expr: 'nextval(106:::REGCLASS)', tableId: 109, usesSequenceIds: [106]} - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 109} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 109} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -139,7 +139,7 @@ DROP OWNED BY r - [[ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 108} - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 108} + {columnId: 1, tableId: 108} - [[ColumnName:{DescID: 108, Name: id, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: id, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] @@ -147,13 +147,13 @@ DROP OWNED BY r - [[ColumnNotNull:{DescID: 108, ColumnID: 1, IndexID: 0}, ABSENT], PUBLIC] {columnId: 1, tableId: 108} - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 108} + {columnId: 2, tableId: 108} - [[ColumnName:{DescID: 108, Name: name, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: name, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 108, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 108} + {columnId: 3, tableId: 108} - [[ColumnName:{DescID: 108, Name: val, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: val, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] @@ -161,13 +161,13 @@ DROP OWNED BY r - [[ColumnDefaultExpression:{DescID: 108, ColumnID: 3, ReferencedSequenceIDs: [107]}, ABSENT], PUBLIC] {columnId: 3, expr: 'nextval(107:::REGCLASS)', tableId: 108, usesSequenceIds: [107]} - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 108} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 108} - [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 108} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 108} - [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -199,19 +199,19 @@ DROP OWNED BY r - [[SchemaChild:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] {childObjectId: 110, schemaId: 105} - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 110} + {columnId: 1, tableId: 110} - [[ColumnName:{DescID: 110, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 110} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 110} - [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 110} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 110} - [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -259,25 +259,25 @@ DROP OWNED BY r - [[SchemaChild:{DescID: 113, ReferencedDescID: 105}, ABSENT], PUBLIC] {childObjectId: 113, schemaId: 105} - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 113} + {columnId: 1, tableId: 113} - [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: k, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 113, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 113} + {columnId: 2, tableId: 113} - [[ColumnName:{DescID: 113, Name: name, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: name, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 113, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 113} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 113} - [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 113, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 113} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 113} - [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 113} - [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_schema b/pkg/sql/schemachanger/scbuild/testdata/drop_schema index 561cd2fd56c7..283919db5da6 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_schema +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_schema @@ -64,7 +64,7 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 107} - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 107} + {columnId: 1, tableId: 107} - [[ColumnName:{DescID: 107, Name: id, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: id, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] @@ -74,13 +74,13 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[ColumnComment:{DescID: 107, ColumnID: 1, Comment: id is good}, ABSENT], PUBLIC] {columnId: 1, comment: id is good, pgAttributeNum: 1, tableId: 107} - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 107} + {columnId: 2, tableId: 107} - [[ColumnName:{DescID: 107, Name: name, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: name, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 107} + {columnId: 3, tableId: 107} - [[ColumnName:{DescID: 107, Name: val, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: val, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] @@ -88,13 +88,13 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[ColumnDefaultExpression:{DescID: 107, ColumnID: 3, ReferencedSequenceIDs: [106]}, ABSENT], PUBLIC] {columnId: 3, expr: 'nextval(106:::REGCLASS)', tableId: 107, usesSequenceIds: [106]} - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 107} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 107} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -128,19 +128,19 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[SchemaChild:{DescID: 108, ReferencedDescID: 104}, ABSENT], PUBLIC] {childObjectId: 108, schemaId: 104} - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 108} + {columnId: 1, tableId: 108} - [[ColumnName:{DescID: 108, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 108} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 108} - [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 108} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 108} - [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -158,25 +158,25 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[SchemaChild:{DescID: 109, ReferencedDescID: 104}, ABSENT], PUBLIC] {childObjectId: 109, schemaId: 104} - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 109} + {columnId: 1, tableId: 109} - [[ColumnName:{DescID: 109, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: n1, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 109} + {columnId: 2, tableId: 109} - [[ColumnName:{DescID: 109, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 109} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 109} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -194,25 +194,25 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[SchemaChild:{DescID: 110, ReferencedDescID: 104}, ABSENT], PUBLIC] {childObjectId: 110, schemaId: 104} - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 110} + {columnId: 1, tableId: 110} - [[ColumnName:{DescID: 110, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 110} + {columnId: 2, tableId: 110} - [[ColumnName:{DescID: 110, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n1, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 110} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 110} - [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 110, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 110} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 110} - [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 110} - [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -230,25 +230,25 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[SchemaChild:{DescID: 111, ReferencedDescID: 104}, ABSENT], PUBLIC] {childObjectId: 111, schemaId: 104} - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 111} + {columnId: 1, tableId: 111} - [[ColumnName:{DescID: 111, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: n2, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 111} + {columnId: 2, tableId: 111} - [[ColumnName:{DescID: 111, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n1, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 111} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 111} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -296,31 +296,31 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[SchemaChild:{DescID: 114, ReferencedDescID: 104}, ABSENT], PUBLIC] {childObjectId: 114, schemaId: 104} - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 114} + {columnId: 1, tableId: 114} - [[ColumnName:{DescID: 114, Name: k, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: k, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 114} + {columnId: 2, tableId: 114} - [[ColumnName:{DescID: 114, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 114, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 114} + {columnId: 3, tableId: 114} - [[ColumnName:{DescID: 114, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: n1, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 114} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 114} - [[ColumnName:{DescID: 114, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 114, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 114} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 114} - [[ColumnName:{DescID: 114, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 114} - [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -338,31 +338,31 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[SchemaChild:{DescID: 115, ReferencedDescID: 105}, ABSENT], PUBLIC] {childObjectId: 115, schemaId: 105} - [[Column:{DescID: 115, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 115} + {columnId: 1, tableId: 115} - [[ColumnName:{DescID: 115, Name: k, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: k, tableId: 115} - [[ColumnType:{DescID: 115, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 115, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 115, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 115} + {columnId: 2, tableId: 115} - [[ColumnName:{DescID: 115, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 115} - [[ColumnType:{DescID: 115, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 115, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 115, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 115} + {columnId: 3, tableId: 115} - [[ColumnName:{DescID: 115, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: n1, tableId: 115} - [[ColumnType:{DescID: 115, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 115, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 115, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 115} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 115} - [[ColumnName:{DescID: 115, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 115} - [[ColumnType:{DescID: 115, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 115, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 115, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 115} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 115} - [[ColumnName:{DescID: 115, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 115} - [[ColumnType:{DescID: 115, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_table b/pkg/sql/schemachanger/scbuild/testdata/drop_table index e8140a987b3c..8a66c0c26702 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_table +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_table @@ -46,7 +46,7 @@ DROP TABLE defaultdb.shipments CASCADE; - [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] {name: primary, tableId: 109} - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 109} + {columnId: 1, tableId: 109} - [[ColumnName:{DescID: 109, Name: tracking_number, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: tracking_number, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] @@ -58,7 +58,7 @@ DROP TABLE defaultdb.shipments CASCADE; - [[ColumnComment:{DescID: 109, ColumnID: 1, Comment: tracking_number is good}, ABSENT], PUBLIC] {columnId: 1, comment: tracking_number is good, pgAttributeNum: 1, tableId: 109} - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 109} + {columnId: 2, tableId: 109} - [[ColumnName:{DescID: 109, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: carrier, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] @@ -66,19 +66,19 @@ DROP TABLE defaultdb.shipments CASCADE; - [[SequenceOwner:{DescID: 109, ColumnID: 2, ReferencedDescID: 110}, ABSENT], PUBLIC] {columnId: 2, sequenceId: 110, tableId: 109} - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 109} + {columnId: 3, tableId: 109} - [[ColumnName:{DescID: 109, Name: status, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: status, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 109, ColumnID: 4}, ABSENT], PUBLIC] - {columnId: 4, pgAttributeNum: 4, tableId: 109} + {columnId: 4, tableId: 109} - [[ColumnName:{DescID: 109, Name: customer_id, ColumnID: 4}, ABSENT], PUBLIC] {columnId: 4, name: customer_id, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] {columnId: 4, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: IntFamily, oid: 20, width: 64}} - [[Column:{DescID: 109, ColumnID: 5}, ABSENT], PUBLIC] - {columnId: 5, pgAttributeNum: 5, tableId: 109} + {columnId: 5, tableId: 109} - [[ColumnName:{DescID: 109, Name: randcol, ColumnID: 5}, ABSENT], PUBLIC] {columnId: 5, name: randcol, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 5}, ABSENT], PUBLIC] @@ -86,19 +86,19 @@ DROP TABLE defaultdb.shipments CASCADE; - [[ColumnDefaultExpression:{DescID: 109, ColumnID: 5, ReferencedSequenceIDs: [106]}, ABSENT], PUBLIC] {columnId: 5, expr: 'nextval(106:::REGCLASS)', tableId: 109, usesSequenceIds: [106]} - [[Column:{DescID: 109, ColumnID: 6}, ABSENT], PUBLIC] - {columnId: 6, pgAttributeNum: 6, tableId: 109} + {columnId: 6, tableId: 109} - [[ColumnName:{DescID: 109, Name: val, ColumnID: 6}, ABSENT], PUBLIC] {columnId: 6, name: val, tableId: 109} - [[ColumnType:{DescID: 109, ReferencedTypeIDs: [107 108], ColumnFamilyID: 0, ColumnID: 6}, ABSENT], PUBLIC] {closedTypeIds: [107, 108], columnId: 6, computeExpr: {expr: 'x''80'':::@100107', usesTypeIds: [107, 108]}, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: EnumFamily, oid: 100107, udtMetadata: {arrayTypeOid: 100108}}} - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 109} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 109, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 109} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 109} - [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 109} - [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -162,25 +162,25 @@ DROP TABLE defaultdb.shipments CASCADE; - [[SchemaChild:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 111, schemaId: 101} - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 111} + {columnId: 1, tableId: 111} - [[ColumnName:{DescID: 111, Name: customer_id, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: customer_id, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: IntFamily, oid: 20, width: 64}} - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 111} + {columnId: 2, tableId: 111} - [[ColumnName:{DescID: 111, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: carrier, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 111} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 111} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_view b/pkg/sql/schemachanger/scbuild/testdata/drop_view index de9694777b0a..013bc40cd431 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_view +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_view @@ -19,19 +19,19 @@ DROP VIEW defaultdb.v1 - [[SchemaChild:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 105, schemaId: 101} - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 105} + {columnId: 1, tableId: 105} - [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 105, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 105} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 105, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 105} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -61,19 +61,19 @@ DROP VIEW defaultdb.v1 CASCADE - [[SchemaChild:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 105, schemaId: 101} - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 105} + {columnId: 1, tableId: 105} - [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 105, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 105} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 105, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 105} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 105} - [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 105} - [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -91,25 +91,25 @@ DROP VIEW defaultdb.v1 CASCADE - [[SchemaChild:{DescID: 106, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 106, schemaId: 101} - [[Column:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 106} + {columnId: 1, tableId: 106} - [[ColumnName:{DescID: 106, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: n1, tableId: 106} - [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 106, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 106} + {columnId: 2, tableId: 106} - [[ColumnName:{DescID: 106, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 106} - [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 106, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 106} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 106} - [[ColumnName:{DescID: 106, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 106} - [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 106, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 106} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 106} - [[ColumnName:{DescID: 106, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 106} - [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -127,25 +127,25 @@ DROP VIEW defaultdb.v1 CASCADE - [[SchemaChild:{DescID: 107, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 107, schemaId: 101} - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 107} + {columnId: 1, tableId: 107} - [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: name, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 107} + {columnId: 2, tableId: 107} - [[ColumnName:{DescID: 107, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n1, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 107} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 107, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 107} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 107} - [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 107} - [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -163,25 +163,25 @@ DROP VIEW defaultdb.v1 CASCADE - [[SchemaChild:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 108, schemaId: 101} - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 108} + {columnId: 1, tableId: 108} - [[ColumnName:{DescID: 108, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: n2, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 108} + {columnId: 2, tableId: 108} - [[ColumnName:{DescID: 108, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n1, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 108} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 108} - [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 108, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 108} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 108} - [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 108} - [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] @@ -199,31 +199,31 @@ DROP VIEW defaultdb.v1 CASCADE - [[SchemaChild:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] {childObjectId: 111, schemaId: 101} - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - {columnId: 1, pgAttributeNum: 1, tableId: 111} + {columnId: 1, tableId: 111} - [[ColumnName:{DescID: 111, Name: k, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, name: k, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] {columnId: 1, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 25}} - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] - {columnId: 2, pgAttributeNum: 2, tableId: 111} + {columnId: 2, tableId: 111} - [[ColumnName:{DescID: 111, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, name: n2, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] {columnId: 2, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 111, ColumnID: 3}, ABSENT], PUBLIC] - {columnId: 3, pgAttributeNum: 3, tableId: 111} + {columnId: 3, tableId: 111} - [[ColumnName:{DescID: 111, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, name: n1, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] {columnId: 3, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: StringFamily, oid: 1043, visibleType: 7, width: 256}} - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] - {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967295e+09, tableId: 111} + {columnId: 4.294967295e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, name: crdb_internal_mvcc_timestamp, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] {columnId: 4.294967295e+09, elementCreationMetadata: {in231OrLater: true}, isNullable: true, tableId: 111, type: {family: DecimalFamily, oid: 1700}} - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] - {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, pgAttributeNum: 4.294967294e+09, tableId: 111} + {columnId: 4.294967294e+09, isHidden: true, isSystemColumn: true, tableId: 111} - [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] {columnId: 4.294967294e+09, name: tableoid, tableId: 111} - [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] diff --git a/pkg/sql/schemachanger/scdecomp/decomp.go b/pkg/sql/schemachanger/scdecomp/decomp.go index d378eb8ed6d6..cad60de24692 100644 --- a/pkg/sql/schemachanger/scdecomp/decomp.go +++ b/pkg/sql/schemachanger/scdecomp/decomp.go @@ -430,9 +430,12 @@ func (w *walkCtx) walkColumn(tbl catalog.TableDescriptor, col catalog.Column) { IsInaccessible: col.IsInaccessible(), GeneratedAsIdentityType: col.GetGeneratedAsIdentityType(), GeneratedAsIdentitySequenceOption: col.GetGeneratedAsIdentitySequenceOptionStr(), - PgAttributeNum: col.GetPGAttributeNum(), IsSystemColumn: col.IsSystemColumn(), } + // Only set PgAttributeNum if it differs from ColumnID. + if pgAttNum := col.GetPGAttributeNum(); pgAttNum != catid.PGAttributeNum(col.GetID()) { + column.PgAttributeNum = pgAttNum + } w.ev(maybeMutationStatus(col), column) w.ev(scpb.Status_PUBLIC, &scpb.ColumnName{ TableID: tbl.GetID(), diff --git a/pkg/sql/schemachanger/scdecomp/testdata/other b/pkg/sql/schemachanger/scdecomp/testdata/other index cbc7fd081d2f..cea0e84739eb 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/other +++ b/pkg/sql/schemachanger/scdecomp/testdata/other @@ -234,7 +234,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 112 Status: PUBLIC - Column: @@ -244,7 +244,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 112 Status: PUBLIC - Column: @@ -254,7 +254,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 112 Status: PUBLIC - ColumnName: @@ -407,7 +407,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 113 Status: PUBLIC - Column: @@ -417,7 +417,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 113 Status: PUBLIC - Column: @@ -427,7 +427,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 113 Status: PUBLIC - Column: @@ -437,7 +437,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 113 Status: PUBLIC - ColumnName: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/sequence b/pkg/sql/schemachanger/scdecomp/testdata/sequence index a7b89684908d..7830ba33e948 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/sequence +++ b/pkg/sql/schemachanger/scdecomp/testdata/sequence @@ -116,7 +116,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -126,7 +126,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -136,7 +136,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -146,7 +146,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - PrimaryIndex: @@ -423,7 +423,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -433,7 +433,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -443,7 +443,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -453,7 +453,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/table b/pkg/sql/schemachanger/scdecomp/testdata/table index 21811b7c6df4..ff8f35d968ce 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/table +++ b/pkg/sql/schemachanger/scdecomp/testdata/table @@ -45,7 +45,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -55,7 +55,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -65,7 +65,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - PrimaryIndex: @@ -255,7 +255,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -265,7 +265,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -275,7 +275,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 3 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -285,7 +285,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - Column: @@ -295,7 +295,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 105 Status: PUBLIC - PrimaryIndex: @@ -788,7 +788,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -798,7 +798,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -808,7 +808,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - Column: @@ -818,7 +818,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 104 Status: PUBLIC - PrimaryIndex: @@ -1055,7 +1055,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - Column: @@ -1065,7 +1065,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - Column: @@ -1075,7 +1075,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - Column: @@ -1085,7 +1085,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 109 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/type b/pkg/sql/schemachanger/scdecomp/testdata/type index df1804103a6c..f7395274e7d8 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/type +++ b/pkg/sql/schemachanger/scdecomp/testdata/type @@ -89,7 +89,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -99,7 +99,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -109,7 +109,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 3 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -119,7 +119,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 4 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -129,7 +129,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -139,7 +139,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - Column: @@ -149,7 +149,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 5 + pgAttributeNum: 0 tableId: 108 Status: PUBLIC - PrimaryIndex: @@ -736,7 +736,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 1 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -746,7 +746,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 2 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -756,7 +756,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 3 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -766,7 +766,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 4 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -776,7 +776,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967294e+09 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -786,7 +786,7 @@ ElementState: isHidden: true isInaccessible: false isSystemColumn: true - pgAttributeNum: 4.294967295e+09 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -796,7 +796,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 5 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -806,7 +806,7 @@ ElementState: isHidden: false isInaccessible: false isSystemColumn: false - pgAttributeNum: 6 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - Column: @@ -816,7 +816,7 @@ ElementState: isHidden: false isInaccessible: true isSystemColumn: false - pgAttributeNum: 7 + pgAttributeNum: 0 tableId: 111 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/comment.go b/pkg/sql/schemachanger/scexec/scmutationexec/comment.go index 9fd113aa7f1c..4fff292a6577 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/comment.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/comment.go @@ -39,7 +39,12 @@ func (i *immediateVisitor) UpsertTableComment(_ context.Context, op scop.UpsertT func (i *immediateVisitor) UpsertColumnComment( _ context.Context, op scop.UpsertColumnComment, ) error { - i.AddComment(op.TableID, int(op.PGAttributeNum), catalogkeys.ColumnCommentType, op.Comment) + subID := int(op.ColumnID) + if op.PGAttributeNum != 0 { + // PGAttributeNum is only set if it differs from the ColumnID. + subID = int(op.PGAttributeNum) + } + i.AddComment(op.TableID, subID, catalogkeys.ColumnCommentType, op.Comment) return nil } diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column index a93cadd9ce73..6ab9ba7453e2 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column @@ -16,7 +16,6 @@ StatementPhase stage 1 of 1 with 5 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -67,7 +66,6 @@ PreCommitPhase stage 2 of 2 with 9 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -184,7 +182,6 @@ StatementPhase stage 1 of 1 with 10 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -273,7 +270,6 @@ PreCommitPhase stage 2 of 2 with 14 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -559,7 +555,6 @@ StatementPhase stage 1 of 1 with 16 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -586,7 +581,6 @@ StatementPhase stage 1 of 1 with 16 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 3 - PgAttributeNum: 3 TableID: 104 *scop.SetColumnName ColumnID: 3 @@ -700,7 +694,6 @@ PreCommitPhase stage 2 of 2 with 20 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -727,7 +720,6 @@ PreCommitPhase stage 2 of 2 with 20 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 3 - PgAttributeNum: 3 TableID: 104 *scop.SetColumnName ColumnID: 3 @@ -1019,7 +1011,6 @@ StatementPhase stage 1 of 1 with 9 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -1105,7 +1096,6 @@ PreCommitPhase stage 2 of 2 with 13 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -1373,7 +1363,6 @@ StatementPhase stage 1 of 1 with 8 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -1399,7 +1388,6 @@ StatementPhase stage 1 of 1 with 8 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 3 - PgAttributeNum: 3 TableID: 107 *scop.SetColumnName ColumnID: 3 @@ -1450,7 +1438,6 @@ PreCommitPhase stage 2 of 2 with 11 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 104 *scop.SetColumnName ColumnID: 2 @@ -1476,7 +1463,6 @@ PreCommitPhase stage 2 of 2 with 11 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 3 - PgAttributeNum: 3 TableID: 107 *scop.SetColumnName ColumnID: 3 @@ -2042,7 +2028,6 @@ StatementPhase stage 1 of 1 with 10 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 109 *scop.SetColumnName ColumnID: 2 @@ -2132,7 +2117,6 @@ PreCommitPhase stage 2 of 2 with 14 MutationType ops *scop.MakeAbsentColumnDeleteOnly Column: ColumnID: 2 - PgAttributeNum: 2 TableID: 109 *scop.SetColumnName ColumnID: 2 diff --git a/pkg/sql/schemachanger/scplan/testdata/comment_on b/pkg/sql/schemachanger/scplan/testdata/comment_on index 94010bd7bd9e..d9617bd3bbef 100644 --- a/pkg/sql/schemachanger/scplan/testdata/comment_on +++ b/pkg/sql/schemachanger/scplan/testdata/comment_on @@ -90,7 +90,6 @@ StatementPhase stage 1 of 1 with 1 MutationType op *scop.UpsertColumnComment ColumnID: 1 Comment: id is important - PGAttributeNum: 1 TableID: 107 PreCommitPhase stage 1 of 2 with 1 MutationType op transitions: @@ -105,7 +104,6 @@ PreCommitPhase stage 2 of 2 with 1 MutationType op *scop.UpsertColumnComment ColumnID: 1 Comment: id is important - PGAttributeNum: 1 TableID: 107 ops diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column b/pkg/sql/schemachanger/testdata/end_to_end/add_column index 3730a6118abb..5f01b2a1d567 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column @@ -87,7 +87,6 @@ upsert descriptor #106 + id: 3 + name: j + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -211,7 +210,6 @@ upsert descriptor #106 + id: 3 + name: j + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -438,7 +436,6 @@ upsert descriptor #106 + - defaultExpr: 42:::INT8 + id: 3 + name: j - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -459,7 +456,6 @@ upsert descriptor #106 - id: 3 - name: j - nullable: true - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq index 077052246cdf..66c48d9fbd42 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq @@ -83,7 +83,6 @@ upsert descriptor #106 + id: 2 + name: l + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -219,7 +218,6 @@ upsert descriptor #106 + id: 2 + name: l + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -489,7 +487,6 @@ upsert descriptor #106 + - defaultExpr: nextval(107:::REGCLASS) + id: 2 + name: l - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -512,7 +509,6 @@ upsert descriptor #106 - id: 2 - name: l - nullable: true - - pgAttributeNum: 2 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique index 669a9c37aaac..aecda174f71f 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique @@ -120,7 +120,6 @@ upsert descriptor #106 + id: 2 + name: j + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -239,7 +238,6 @@ upsert descriptor #106 + id: 2 + name: j + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -655,7 +653,6 @@ upsert descriptor #106 + id: 2 + name: j + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -700,7 +697,6 @@ upsert descriptor #106 - id: 2 - name: j - nullable: true - - pgAttributeNum: 2 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default b/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default index 119937ee066b..f1e1f8a29e11 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default @@ -68,7 +68,6 @@ upsert descriptor #106 + id: 2 + name: j + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -135,7 +134,6 @@ upsert descriptor #106 + id: 2 + name: j + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -205,7 +203,6 @@ upsert descriptor #106 + - id: 2 + name: j + nullable: true - + pgAttributeNum: 2 + type: + family: IntFamily + oid: 20 @@ -234,7 +231,6 @@ upsert descriptor #106 - id: 2 - name: j - nullable: true - - pgAttributeNum: 2 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored index 828785d8d58d..c6808bda00a2 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored @@ -101,7 +101,6 @@ upsert descriptor #106 + id: 3 + name: j + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -225,7 +224,6 @@ upsert descriptor #106 + id: 3 + name: j + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -452,7 +450,6 @@ upsert descriptor #106 + - computeExpr: k + id: 3 + name: j - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -473,7 +470,6 @@ upsert descriptor #106 - id: 3 - name: j - nullable: true - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family index eb333a753840..006b572e826f 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_with_stored_family @@ -101,7 +101,6 @@ upsert descriptor #106 + id: 3 + name: j + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -228,7 +227,6 @@ upsert descriptor #106 + id: 3 + name: j + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -456,7 +454,6 @@ upsert descriptor #106 + - computeExpr: k + id: 3 + name: j - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -477,7 +474,6 @@ upsert descriptor #106 - id: 3 - name: j - nullable: true - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash index 312fed1b8927..de1a1726a7de 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_using_hash @@ -42,7 +42,6 @@ upsert descriptor #104 + id: 3 + name: crdb_internal_j_shard_3 + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -246,7 +245,6 @@ upsert descriptor #104 + id: 3 + name: crdb_internal_j_shard_3 + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -584,7 +582,6 @@ upsert descriptor #104 + hidden: true + id: 3 + name: crdb_internal_j_shard_3 - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -632,7 +629,6 @@ upsert descriptor #104 - id: 3 - name: crdb_internal_j_shard_3 - nullable: true - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index index f8c16995f23a..cf1f5e9fc0b0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index @@ -64,7 +64,6 @@ upsert descriptor #104 - hidden: true - id: 3 - name: crdb_internal_j_shard_16 - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 @@ -173,7 +172,6 @@ upsert descriptor #104 + id: 3 + name: crdb_internal_column_3_name_placeholder + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -221,7 +219,6 @@ upsert descriptor #104 - hidden: true - id: 3 - name: crdb_internal_j_shard_16 - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 @@ -344,7 +341,6 @@ upsert descriptor #104 + id: 3 + name: crdb_internal_column_3_name_placeholder + nullable: true - + pgAttributeNum: 3 + type: + family: IntFamily + oid: 20 @@ -517,7 +513,6 @@ upsert descriptor #104 - id: 3 - name: crdb_internal_column_3_name_placeholder - nullable: true - - pgAttributeNum: 3 - type: - family: IntFamily - oid: 20 diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index index c1bc7df90013..08532f121ad0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index @@ -36,7 +36,6 @@ upsert descriptor #104 - inaccessible: true - name: crdb_internal_idx_expr - nullable: true - - pgAttributeNum: 3 - type: - family: StringFamily - oid: 25 @@ -98,7 +97,6 @@ upsert descriptor #104 + inaccessible: true + name: crdb_internal_column_3_name_placeholder + nullable: true - + pgAttributeNum: 3 + type: + family: StringFamily + oid: 25 @@ -128,7 +126,6 @@ upsert descriptor #104 - inaccessible: true - name: crdb_internal_idx_expr - nullable: true - - pgAttributeNum: 3 - type: - family: StringFamily - oid: 25 @@ -204,7 +201,6 @@ upsert descriptor #104 + inaccessible: true + name: crdb_internal_column_3_name_placeholder + nullable: true - + pgAttributeNum: 3 + type: + family: StringFamily + oid: 25 @@ -312,7 +308,6 @@ upsert descriptor #104 - inaccessible: true - name: crdb_internal_column_3_name_placeholder - nullable: true - - pgAttributeNum: 3 - type: - family: StringFamily - oid: 25 diff --git a/pkg/sql/schemachanger/testdata/explain/add_column b/pkg/sql/schemachanger/testdata/explain/add_column index 2f4000feeddb..1f89cdc015e8 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column +++ b/pkg/sql/schemachanger/testdata/explain/add_column @@ -28,7 +28,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 3} │ └── 12 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"PgAttributeNum":3,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"TableID":106}} │ ├── SetColumnName {"ColumnID":3,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":3,"TableID":106}} @@ -76,7 +76,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 3} │ └── 16 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"PgAttributeNum":3,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"TableID":106}} │ ├── SetColumnName {"ColumnID":3,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":3,"TableID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_seq b/pkg/sql/schemachanger/testdata/explain/add_column_default_seq index 23709802c16d..d2befd9a810d 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_seq @@ -23,7 +23,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ └── 11 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"TableID":106}} │ ├── SetColumnName {"ColumnID":2,"Name":"l","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} @@ -66,7 +66,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ └── 16 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"TableID":106}} │ ├── SetColumnName {"ColumnID":2,"Name":"l","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique index 1a5550890c52..760b2fd7924c 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique @@ -22,7 +22,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ └── 10 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"TableID":106}} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"IsNullable":true,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} @@ -64,7 +64,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ └── 14 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"TableID":106}} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"IsNullable":true,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_no_default b/pkg/sql/schemachanger/testdata/explain/add_column_no_default index 979a81695b6c..e3ffd1d584a2 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/explain/add_column_no_default @@ -14,7 +14,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 1} │ └── 4 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"TableID":106}} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"IsNullable":true,"TableID":106}} │ └── AddColumnToIndex {"ColumnID":2,"IndexID":1,"Kind":2,"TableID":106} @@ -34,7 +34,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 1} │ └── 6 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"TableID":106}} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"IsNullable":true,"TableID":106}} │ ├── AddColumnToIndex {"ColumnID":2,"IndexID":1,"Kind":2,"TableID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_with_stored b/pkg/sql/schemachanger/testdata/explain/add_column_with_stored index df6d2dfa60f2..e072af5f7953 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_with_stored +++ b/pkg/sql/schemachanger/testdata/explain/add_column_with_stored @@ -25,7 +25,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 3} │ └── 11 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"PgAttributeNum":3,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"TableID":106}} │ ├── SetColumnName {"ColumnID":3,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"TableID":106}} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":2,"IsUnique":true,"SourceIndexID":1,"TableID":106,"TemporaryIndexID":3}} @@ -70,7 +70,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 3} │ └── 15 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"PgAttributeNum":3,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"TableID":106}} │ ├── SetColumnName {"ColumnID":3,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"TableID":106}} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":2,"IsUnique":true,"SourceIndexID":1,"TableID":106,"TemporaryIndexID":3}} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_with_stored_family b/pkg/sql/schemachanger/testdata/explain/add_column_with_stored_family index e2f2a0d97134..ec64866674a8 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_with_stored_family +++ b/pkg/sql/schemachanger/testdata/explain/add_column_with_stored_family @@ -26,7 +26,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 3} │ └── 12 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"PgAttributeNum":3,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"TableID":106}} │ ├── AddColumnFamily {"FamilyID":1,"Name":"bob","TableID":106} │ ├── SetColumnName {"ColumnID":3,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"FamilyID":1,"TableID":106}} @@ -74,7 +74,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 3} │ └── 16 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"PgAttributeNum":3,"TableID":106}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"TableID":106}} │ ├── AddColumnFamily {"FamilyID":1,"Name":"bob","TableID":106} │ ├── SetColumnName {"ColumnID":3,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"FamilyID":1,"TableID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_using_hash b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_using_hash index 2613d21d0e5f..71ce456ce3ff 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_using_hash +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_using_hash @@ -34,7 +34,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ └── 22 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"IsHidden":true,"PgAttributeNum":3,"TableID":104}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"IsHidden":true,"TableID":104}} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_j_...","TableID":104} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"IsVirtual":true,"TableID":104}} │ ├── AddCheckConstraint {"CheckExpr":"\"crdb_internal_j...","ConstraintID":2,"FromHashShardedColumn":true,"TableID":104,"Validity":2} @@ -114,7 +114,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ └── 28 Mutation operations - │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"IsHidden":true,"PgAttributeNum":3,"TableID":104}} + │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":3,"IsHidden":true,"TableID":104}} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_j_...","TableID":104} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":3,"IsVirtual":true,"TableID":104}} │ ├── AddCheckConstraint {"CheckExpr":"\"crdb_internal_j...","ConstraintID":2,"FromHashShardedColumn":true,"TableID":104,"Validity":2} diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column b/pkg/sql/schemachanger/testdata/explain_verbose/add_column index 719f22c02b0d..eca7c0927b64 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column @@ -116,7 +116,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 3 -│ │ PgAttributeNum: 3 │ │ TableID: 106 │ │ │ ├── • SetColumnName @@ -351,7 +350,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 3 -│ │ PgAttributeNum: 3 │ │ TableID: 106 │ │ │ ├── • SetColumnName diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq index 2b901f9c6ecf..12bf2cfb8f93 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq @@ -101,7 +101,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 2 -│ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ │ ├── • SetColumnName @@ -312,7 +311,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 2 -│ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ │ ├── • SetColumnName diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique index 7b2e810dc405..584764274aca 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique @@ -100,7 +100,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 2 -│ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ │ ├── • SetColumnName @@ -304,7 +303,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 2 -│ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ │ ├── • SetColumnName diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default index 70c36cef91ba..5dfd16ebfe5d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default @@ -44,7 +44,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 2 -│ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ │ ├── • SetColumnName @@ -129,7 +128,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 2 -│ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ │ ├── • SetColumnName diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored index f19c36c9a88b..a79d0cb08d31 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored @@ -108,7 +108,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL AS (k │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 3 -│ │ PgAttributeNum: 3 │ │ TableID: 106 │ │ │ ├── • SetColumnName @@ -331,7 +330,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL AS (k │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 3 -│ │ PgAttributeNum: 3 │ │ TableID: 106 │ │ │ ├── • SetColumnName diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored_family b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored_family index 664b3af28b08..542dc5e8c4fa 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored_family +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_with_stored_family @@ -111,7 +111,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL AS (k │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 3 -│ │ PgAttributeNum: 3 │ │ TableID: 106 │ │ │ ├── • AddColumnFamily @@ -346,7 +345,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL AS (k │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: │ │ ColumnID: 3 -│ │ PgAttributeNum: 3 │ │ TableID: 106 │ │ │ ├── • AddColumnFamily diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_using_hash b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_using_hash index 03077eda9a62..fa0bf15e164e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_using_hash +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_using_hash @@ -190,7 +190,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING H │ │ Column: │ │ ColumnID: 3 │ │ IsHidden: true -│ │ PgAttributeNum: 3 │ │ TableID: 104 │ │ │ ├── • SetColumnName @@ -617,7 +616,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING H │ │ Column: │ │ ColumnID: 3 │ │ IsHidden: true -│ │ PgAttributeNum: 3 │ │ TableID: 104 │ │ │ ├── • SetColumnName diff --git a/pkg/upgrade/upgradejob/upgrade_job.go b/pkg/upgrade/upgradejob/upgrade_job.go index 4c164acba4c6..e2cbda8688d3 100644 --- a/pkg/upgrade/upgradejob/upgrade_job.go +++ b/pkg/upgrade/upgradejob/upgrade_job.go @@ -105,7 +105,7 @@ func (r resumer) Resume(ctx context.Context, execCtxI interface{}) error { txn *kv.Txn, descriptors *descs.Collection, currDb string, ) (resolver.SchemaResolver, func(), error) { opName := "internal-planner-for-upgrades" - sd := sql.NewInternalSessionData(ctx, execCtx.ExecCfg().Settings, opName) + sd := execCtx.SessionData().Clone() sd.Database = currDb internalPlanner, cleanup := sql.NewInternalPlanner( opName, diff --git a/pkg/upgrade/upgrades/schema_changes.go b/pkg/upgrade/upgrades/schema_changes.go index 56fb82152aa2..df2d2197bca4 100644 --- a/pkg/upgrade/upgrades/schema_changes.go +++ b/pkg/upgrade/upgrades/schema_changes.go @@ -18,6 +18,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/sql/catalog" + "github.com/cockroachdb/cockroach/pkg/sql/catalog/catpb" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descs" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" @@ -89,6 +90,7 @@ func migrateTable( } // Wait for any in-flight schema changes to complete. + // Check legacy schema changer jobs. if mutations := storedTable.GetMutationJobs(); len(mutations) > 0 { for _, mutation := range mutations { log.Infof(ctx, "waiting for the mutation job %v to complete", mutation.JobID) @@ -99,7 +101,15 @@ func migrateTable( } continue } - + // Check declarative schema changer jobs. + if state := storedTable.GetDeclarativeSchemaChangerState(); state != nil && state.JobID != catpb.InvalidJobID { + log.Infof(ctx, "waiting for the mutation job %v to complete", state.JobID) + if _, err := d.InternalExecutor.Exec(ctx, "migration-mutations-wait", + nil, waitForJobStatement, state.JobID); err != nil { + return err + } + continue + } // Ignore the schema change if the table already has the required schema. // Expect all or none. var exists bool