From 1fde0dfd132d8fe0753bea10ced05c631b201715 Mon Sep 17 00:00:00 2001 From: Chengxiong Ruan Date: Mon, 18 Apr 2022 09:32:57 -0400 Subject: [PATCH] sql: fix new schema changer test with PGAttributeNum fix data driven tests. Release note: None. --- .../testdata/decomp/multiregion | 7 ++++ .../testdata/decomp/partitioning | 5 +++ .../testdata/end_to_end/drop_multiregion | 6 ++++ .../testdata/show_trace_nonmetamorphic | 4 +-- .../scbuild/testdata/drop_database | 16 ++++++++++ .../scbuild/testdata/drop_schema | 16 ++++++++++ .../schemachanger/scbuild/testdata/drop_table | 8 +++++ .../schemachanger/scbuild/testdata/drop_view | 11 +++++++ pkg/sql/schemachanger/scdecomp/testdata/other | 3 ++ .../schemachanger/scdecomp/testdata/sequence | 4 +++ pkg/sql/schemachanger/scdecomp/testdata/table | 8 +++++ pkg/sql/schemachanger/scdecomp/testdata/type | 5 +++ pkg/sql/schemachanger/testdata/drop | 32 +++++++++++++++++++ 13 files changed, 123 insertions(+), 2 deletions(-) diff --git a/pkg/ccl/schemachangerccl/testdata/decomp/multiregion b/pkg/ccl/schemachangerccl/testdata/decomp/multiregion index 94f3e898e587..552aa0008d07 100644 --- a/pkg/ccl/schemachangerccl/testdata/decomp/multiregion +++ b/pkg/ccl/schemachangerccl/testdata/decomp/multiregion @@ -69,11 +69,13 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 110 Status: PUBLIC - Column: columnId: 2 isHidden: true + pgAttributeNum: 2 tableId: 110 Status: PUBLIC - PrimaryIndex: @@ -189,11 +191,13 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 109 Status: PUBLIC - Column: columnId: 2 isHidden: true + pgAttributeNum: 2 tableId: 109 Status: PUBLIC - PrimaryIndex: @@ -311,15 +315,18 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 108 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 108 Status: PUBLIC - Column: columnId: 3 isHidden: true + pgAttributeNum: 3 tableId: 108 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/ccl/schemachangerccl/testdata/decomp/partitioning b/pkg/ccl/schemachangerccl/testdata/decomp/partitioning index 1670ac80a40e..262244fa5bff 100644 --- a/pkg/ccl/schemachangerccl/testdata/decomp/partitioning +++ b/pkg/ccl/schemachangerccl/testdata/decomp/partitioning @@ -35,14 +35,17 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 104 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 104 Status: PUBLIC - Column: columnId: 3 + pgAttributeNum: 3 tableId: 104 Status: PUBLIC - PrimaryIndex: @@ -217,10 +220,12 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 105 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 105 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion index 72ee0242f184..7e1bd14431e4 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion @@ -197,6 +197,7 @@ upsert descriptor #108 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 108 + metadata: + sourceElementId: 1 @@ -238,6 +239,7 @@ upsert descriptor #108 + column: + columnId: 2 + isHidden: true + + pgAttributeNum: 2 + tableId: 108 + metadata: + sourceElementId: 1 @@ -537,6 +539,7 @@ upsert descriptor #108 - - elementProto: - column: - columnId: 1 + - pgAttributeNum: 1 - tableId: 108 - metadata: - sourceElementId: 1 @@ -578,6 +581,7 @@ upsert descriptor #108 - column: - columnId: 2 - isHidden: true + - pgAttributeNum: 2 - tableId: 108 - metadata: - sourceElementId: 1 @@ -873,6 +877,7 @@ upsert descriptor #109 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 109 + metadata: + sourceElementId: 1 @@ -1106,6 +1111,7 @@ upsert descriptor #109 - - elementProto: - column: - columnId: 1 + - pgAttributeNum: 1 - tableId: 109 - metadata: - sourceElementId: 1 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic index ffdb70c97493..efaaf8590ba2 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic @@ -164,7 +164,7 @@ query TT $trace_query ---- sql query rows affected: 0 -commit sql txn Put /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 > 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 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: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > 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:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:VALIDATED current_statuses:ABSENT current_statuses:ABSENT 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 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 > +commit sql txn Put /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 > 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 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: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > 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:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:VALIDATED current_statuses:ABSENT current_statuses:ABSENT 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 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 > commit sql txn Del /NamespaceTable/30/1/106/107/"kv2"/4/1 statement ok @@ -205,7 +205,7 @@ query TT $trace_query ---- sql query rows affected: 0 -commit sql txn Put /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 > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view: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: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > 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:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:VALIDATED current_statuses:ABSENT current_statuses:ABSENT 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 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 > +commit sql txn Put /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 > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view: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: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > 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:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:VALIDATED current_statuses:ABSENT current_statuses:ABSENT 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 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 > 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/testdata/drop_database b/pkg/sql/schemachanger/scbuild/testdata/drop_database index 326496b0376f..1e4b5e07b548 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_database +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_database @@ -68,66 +68,82 @@ DROP DATABASE db1 CASCADE - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 109 - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 109 - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 109 - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 110 - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 110 - [[Column:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 110 - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 111 - [[Column:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 112 - [[Column:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 112 - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 113 - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 113 - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 114 - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 114 - [[Column:{DescID: 117, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 117 - [[Column:{DescID: 117, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 117 - [[Column:{DescID: 117, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 117 - [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] details: diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_schema b/pkg/sql/schemachanger/scbuild/testdata/drop_schema index dcb169b60c68..228e7c2ab4a4 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_schema +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_schema @@ -64,66 +64,82 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 107 - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 107 - [[Column:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 107 - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 108 - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 109 - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 109 - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 110 - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 110 - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 111 - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 111 - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 114 - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 114 - [[Column:{DescID: 114, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 114 - [[Column:{DescID: 115, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 115 - [[Column:{DescID: 115, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 115 - [[Column:{DescID: 115, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 115 - [[ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] details: diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_table b/pkg/sql/schemachanger/scbuild/testdata/drop_table index deae7b365f8e..9ca2fe7b46c6 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_table +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_table @@ -46,34 +46,42 @@ DROP TABLE defaultdb.shipments CASCADE; - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 109 - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 109 - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 109 - [[Column:{DescID: 109, ColumnID: 4}, ABSENT], PUBLIC] details: columnId: 4 + pgAttributeNum: 4 tableId: 109 - [[Column:{DescID: 109, ColumnID: 5}, ABSENT], PUBLIC] details: columnId: 5 + pgAttributeNum: 5 tableId: 109 - [[Column:{DescID: 109, ColumnID: 6}, ABSENT], PUBLIC] details: columnId: 6 + pgAttributeNum: 6 tableId: 109 - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 111 - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 111 - [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] details: diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_view b/pkg/sql/schemachanger/scbuild/testdata/drop_view index 67e8dc5ec794..3de3ef611f97 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_view +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_view @@ -12,6 +12,7 @@ DROP VIEW defaultdb.v1 - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 105 - [[ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] details: @@ -95,42 +96,52 @@ DROP VIEW defaultdb.v1 CASCADE - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 105 - [[Column:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 106 - [[Column:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 106 - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 107 - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 107 - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 108 - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 108 - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 + pgAttributeNum: 1 tableId: 111 - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] details: columnId: 2 + pgAttributeNum: 2 tableId: 111 - [[Column:{DescID: 111, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 + pgAttributeNum: 3 tableId: 111 - [[ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] details: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/other b/pkg/sql/schemachanger/scdecomp/testdata/other index e9a037abc86d..a85877fb8bfe 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/other +++ b/pkg/sql/schemachanger/scdecomp/testdata/other @@ -182,6 +182,7 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 112 Status: PUBLIC - TableComment: @@ -248,10 +249,12 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 113 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 113 Status: PUBLIC - TableComment: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/sequence b/pkg/sql/schemachanger/scdecomp/testdata/sequence index 2a095e52bd18..00c68a40f3c3 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/sequence +++ b/pkg/sql/schemachanger/scdecomp/testdata/sequence @@ -100,10 +100,12 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 105 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 105 Status: PUBLIC - PrimaryIndex: @@ -235,10 +237,12 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 105 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 105 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/table b/pkg/sql/schemachanger/scdecomp/testdata/table index bae9cfe5a21a..f83097996e76 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/table +++ b/pkg/sql/schemachanger/scdecomp/testdata/table @@ -24,6 +24,7 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 104 Status: PUBLIC - PrimaryIndex: @@ -108,14 +109,17 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 105 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 105 Status: PUBLIC - Column: columnId: 3 + pgAttributeNum: 3 tableId: 105 Status: PUBLIC - PrimaryIndex: @@ -300,10 +304,12 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 104 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 104 Status: PUBLIC - PrimaryIndex: @@ -416,11 +422,13 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 108 Status: PUBLIC - Column: columnId: 2 isHidden: true + pgAttributeNum: 2 tableId: 108 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/schemachanger/scdecomp/testdata/type b/pkg/sql/schemachanger/scdecomp/testdata/type index 68553d88ff68..e61450f444cc 100644 --- a/pkg/sql/schemachanger/scdecomp/testdata/type +++ b/pkg/sql/schemachanger/scdecomp/testdata/type @@ -66,22 +66,27 @@ ElementState: Status: PUBLIC - Column: columnId: 1 + pgAttributeNum: 1 tableId: 108 Status: PUBLIC - Column: columnId: 2 + pgAttributeNum: 2 tableId: 108 Status: PUBLIC - Column: columnId: 3 + pgAttributeNum: 3 tableId: 108 Status: PUBLIC - Column: columnId: 4 + pgAttributeNum: 4 tableId: 108 Status: PUBLIC - Column: columnId: 5 + pgAttributeNum: 5 tableId: 108 Status: PUBLIC - PrimaryIndex: diff --git a/pkg/sql/schemachanger/testdata/drop b/pkg/sql/schemachanger/testdata/drop index c2b321f65bbe..aee5fff615c8 100644 --- a/pkg/sql/schemachanger/testdata/drop +++ b/pkg/sql/schemachanger/testdata/drop @@ -316,6 +316,7 @@ upsert descriptor #108 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 108 + metadata: + sourceElementId: 1 @@ -357,6 +358,7 @@ upsert descriptor #108 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 108 + metadata: + sourceElementId: 1 @@ -398,6 +400,7 @@ upsert descriptor #108 + column: + columnId: 3 + isHidden: true + + pgAttributeNum: 3 + tableId: 108 + metadata: + sourceElementId: 1 @@ -635,6 +638,7 @@ upsert descriptor #108 - - elementProto: - column: - columnId: 1 + - pgAttributeNum: 1 - tableId: 108 - metadata: - sourceElementId: 1 @@ -676,6 +680,7 @@ upsert descriptor #108 - - elementProto: - column: - columnId: 2 + - pgAttributeNum: 2 - tableId: 108 - metadata: - sourceElementId: 1 @@ -717,6 +722,7 @@ upsert descriptor #108 - column: - columnId: 3 - isHidden: true + - pgAttributeNum: 3 - tableId: 108 - metadata: - sourceElementId: 1 @@ -2115,6 +2121,7 @@ upsert descriptor #116 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 116 + metadata: + sourceElementId: 7 @@ -2155,6 +2162,7 @@ upsert descriptor #116 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 116 + metadata: + sourceElementId: 7 @@ -2197,6 +2205,7 @@ upsert descriptor #116 + - elementProto: + column: + columnId: 3 + + pgAttributeNum: 3 + tableId: 116 + metadata: + sourceElementId: 7 @@ -2430,6 +2439,7 @@ upsert descriptor #117 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 117 + metadata: + sourceElementId: 3 @@ -2470,6 +2480,7 @@ upsert descriptor #117 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 117 + metadata: + sourceElementId: 3 @@ -2512,6 +2523,7 @@ upsert descriptor #117 + - elementProto: + column: + columnId: 3 + + pgAttributeNum: 3 + tableId: 117 + metadata: + sourceElementId: 3 @@ -2737,6 +2749,7 @@ upsert descriptor #118 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 118 + metadata: + sourceElementId: 3 @@ -2778,6 +2791,7 @@ upsert descriptor #118 + column: + columnId: 2 + isHidden: true + + pgAttributeNum: 2 + tableId: 118 + metadata: + sourceElementId: 3 @@ -2990,6 +3004,7 @@ upsert descriptor #119 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 119 + metadata: + sourceElementId: 9 @@ -3149,6 +3164,7 @@ upsert descriptor #120 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 120 + metadata: + sourceElementId: 10 @@ -3191,6 +3207,7 @@ upsert descriptor #120 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 120 + metadata: + sourceElementId: 10 @@ -3351,6 +3368,7 @@ upsert descriptor #121 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 121 + metadata: + sourceElementId: 11 @@ -3393,6 +3411,7 @@ upsert descriptor #121 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 121 + metadata: + sourceElementId: 11 @@ -3552,6 +3571,7 @@ upsert descriptor #122 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 122 + metadata: + sourceElementId: 11 @@ -3594,6 +3614,7 @@ upsert descriptor #122 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 122 + metadata: + sourceElementId: 11 @@ -3973,6 +3994,7 @@ upsert descriptor #125 + - elementProto: + column: + columnId: 1 + + pgAttributeNum: 1 + tableId: 125 + metadata: + sourceElementId: 13 @@ -4013,6 +4035,7 @@ upsert descriptor #125 + - elementProto: + column: + columnId: 2 + + pgAttributeNum: 2 + tableId: 125 + metadata: + sourceElementId: 13 @@ -4055,6 +4078,7 @@ upsert descriptor #125 + - elementProto: + column: + columnId: 3 + + pgAttributeNum: 3 + tableId: 125 + metadata: + sourceElementId: 13 @@ -4445,6 +4469,7 @@ upsert descriptor #116 - - elementProto: - column: - columnId: 1 + - pgAttributeNum: 1 - tableId: 116 - metadata: - sourceElementId: 7 @@ -4485,6 +4510,7 @@ upsert descriptor #116 - - elementProto: - column: - columnId: 2 + - pgAttributeNum: 2 - tableId: 116 - metadata: - sourceElementId: 7 @@ -4527,6 +4553,7 @@ upsert descriptor #116 - - elementProto: - column: - columnId: 3 + - pgAttributeNum: 3 - tableId: 116 - metadata: - sourceElementId: 7 @@ -4753,6 +4780,7 @@ upsert descriptor #117 - - elementProto: - column: - columnId: 1 + - pgAttributeNum: 1 - tableId: 117 - metadata: - sourceElementId: 3 @@ -4793,6 +4821,7 @@ upsert descriptor #117 - - elementProto: - column: - columnId: 2 + - pgAttributeNum: 2 - tableId: 117 - metadata: - sourceElementId: 3 @@ -4835,6 +4864,7 @@ upsert descriptor #117 - - elementProto: - column: - columnId: 3 + - pgAttributeNum: 3 - tableId: 117 - metadata: - sourceElementId: 3 @@ -5057,6 +5087,7 @@ upsert descriptor #118 - - elementProto: - column: - columnId: 1 + - pgAttributeNum: 1 - tableId: 118 - metadata: - sourceElementId: 3 @@ -5098,6 +5129,7 @@ upsert descriptor #118 - column: - columnId: 2 - isHidden: true + - pgAttributeNum: 2 - tableId: 118 - metadata: - sourceElementId: 3