From aedd80f44e2c99794d951a06e479e75de0caa087 Mon Sep 17 00:00:00 2001 From: Chengxiong Ruan Date: Fri, 1 Apr 2022 12:24:19 -0400 Subject: [PATCH] sql/schemachanger: add/fix comment related tests This commit is all about adding/fixing data driven tests. Release note: None --- .../testdata/benchmark_expectations | 26 +- .../testdata/decomp/multiregion | 60 +- .../testdata/decomp/partitioning | 53 -- .../testdata/end_to_end/drop_multiregion | 117 +-- .../testdata/show_trace_nonmetamorphic | 4 +- pkg/sql/schemachanger/scbuild/builder_test.go | 2 +- .../schemachanger/scbuild/testdata/comment_on | 212 +++++ .../scbuild/testdata/drop_database | 144 +-- .../scbuild/testdata/drop_schema | 126 +-- .../scbuild/testdata/drop_sequence | 12 - .../schemachanger/scbuild/testdata/drop_table | 71 +- .../schemachanger/scbuild/testdata/drop_view | 79 -- pkg/sql/schemachanger/scplan/plan_test.go | 2 +- .../schemachanger/scplan/testdata/comment_on | 2 +- .../scplan/testdata/drop_database | 301 +------ .../schemachanger/scplan/testdata/drop_schema | 225 +---- .../scplan/testdata/drop_sequence | 6 - .../schemachanger/scplan/testdata/drop_table | 131 +-- .../schemachanger/scplan/testdata/drop_view | 173 ---- pkg/sql/schemachanger/testdata/comment_on | 180 ++++ pkg/sql/schemachanger/testdata/drop | 826 ++++-------------- 21 files changed, 675 insertions(+), 2077 deletions(-) create mode 100644 pkg/sql/schemachanger/scbuild/testdata/comment_on create mode 100644 pkg/sql/schemachanger/testdata/comment_on diff --git a/pkg/bench/rttanalysis/testdata/benchmark_expectations b/pkg/bench/rttanalysis/testdata/benchmark_expectations index 9e415bbf886b..4c1e260418d0 100644 --- a/pkg/bench/rttanalysis/testdata/benchmark_expectations +++ b/pkg/bench/rttanalysis/testdata/benchmark_expectations @@ -31,22 +31,22 @@ exp,benchmark 15,CreateRole/create_role_with_2_options 16,CreateRole/create_role_with_3_options 14,CreateRole/create_role_with_no_options -14,DropDatabase/drop_database_0_tables -15,DropDatabase/drop_database_1_table -16,DropDatabase/drop_database_2_tables -17,DropDatabase/drop_database_3_tables +16,DropDatabase/drop_database_0_tables +18,DropDatabase/drop_database_1_table +20,DropDatabase/drop_database_2_tables +20,DropDatabase/drop_database_3_tables 20,DropRole/drop_1_role 27,DropRole/drop_2_roles 34,DropRole/drop_3_roles -14,DropSequence/drop_1_sequence -16,DropSequence/drop_2_sequences -18,DropSequence/drop_3_sequences -14,DropTable/drop_1_table -16,DropTable/drop_2_tables -18,DropTable/drop_3_tables -14,DropView/drop_1_view -16,DropView/drop_2_views -18,DropView/drop_3_views +18,DropSequence/drop_1_sequence +21,DropSequence/drop_2_sequences +24,DropSequence/drop_3_sequences +18,DropTable/drop_1_table +21,DropTable/drop_2_tables +24,DropTable/drop_3_tables +18,DropView/drop_1_view +21,DropView/drop_2_views +24,DropView/drop_3_views 14,Grant/grant_all_on_1_table 14,Grant/grant_all_on_2_tables 14,Grant/grant_all_on_3_tables diff --git a/pkg/ccl/schemachangerccl/testdata/decomp/multiregion b/pkg/ccl/schemachangerccl/testdata/decomp/multiregion index 94f3e898e587..cea58b57014d 100644 --- a/pkg/ccl/schemachangerccl/testdata/decomp/multiregion +++ b/pkg/ccl/schemachangerccl/testdata/decomp/multiregion @@ -8,6 +8,10 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_table ( a INT ) LOCALITY REGIONAL BY TABLE IN "us-east2"; CREATE TABLE multi_region_test_db.public.table_global (b INT) LOCALITY GLOBAL; +COMMENT ON DATABASE multi_region_test_db IS 'multi region db is good'; +COMMENT ON TABLE multi_region_test_db.public.table_regional_by_row IS 'regional by row is good'; +COMMENT ON COLUMN multi_region_test_db.public.table_regional_by_row.k IS 'k is good'; +COMMENT ON INDEX multi_region_test_db.public.table_regional_by_row@table_regional_by_row_pkey IS 'pkey is good'; ---- decompose @@ -51,7 +55,7 @@ ElementState: roleName: __placeholder_role_name__ Status: PUBLIC - DatabaseComment: - comment: __placeholder_comment__ + comment: multi region db is good databaseId: 104 Status: PUBLIC @@ -88,10 +92,6 @@ ElementState: - 1 tableId: 110 Status: PUBLIC -- TableComment: - comment: __placeholder_comment__ - tableId: 110 - Status: PUBLIC - TableLocalityGlobal: tableId: 110 Status: PUBLIC @@ -130,26 +130,11 @@ ElementState: expr: unique_rowid() tableId: 110 Status: PUBLIC -- ColumnComment: - columnId: 1 - comment: __placeholder_comment__ - tableId: 110 - Status: PUBLIC -- ColumnComment: - columnId: 2 - comment: __placeholder_comment__ - tableId: 110 - Status: PUBLIC - IndexName: indexId: 1 name: table_global_pkey tableId: 110 Status: PUBLIC -- IndexComment: - comment: __placeholder_comment__ - indexId: 1 - tableId: 110 - Status: PUBLIC - Namespace: databaseId: 104 descriptorId: 110 @@ -208,10 +193,6 @@ ElementState: - 1 tableId: 109 Status: PUBLIC -- TableComment: - comment: __placeholder_comment__ - tableId: 109 - Status: PUBLIC - TableLocalitySecondaryRegion: regionEnumTypeId: 105 regionName: us-east2 @@ -252,26 +233,11 @@ ElementState: expr: unique_rowid() tableId: 109 Status: PUBLIC -- ColumnComment: - columnId: 1 - comment: __placeholder_comment__ - tableId: 109 - Status: PUBLIC -- ColumnComment: - columnId: 2 - comment: __placeholder_comment__ - tableId: 109 - Status: PUBLIC - IndexName: indexId: 1 name: table_regional_by_table_pkey tableId: 109 Status: PUBLIC -- IndexComment: - comment: __placeholder_comment__ - indexId: 1 - tableId: 109 - Status: PUBLIC - Namespace: databaseId: 104 descriptorId: 109 @@ -337,7 +303,7 @@ ElementState: tableId: 108 Status: PUBLIC - TableComment: - comment: __placeholder_comment__ + comment: regional by row is good tableId: 108 Status: PUBLIC - TableLocalityRegionalByRow: @@ -400,17 +366,7 @@ ElementState: Status: PUBLIC - ColumnComment: columnId: 1 - comment: __placeholder_comment__ - tableId: 108 - Status: PUBLIC -- ColumnComment: - columnId: 2 - comment: __placeholder_comment__ - tableId: 108 - Status: PUBLIC -- ColumnComment: - columnId: 3 - comment: __placeholder_comment__ + comment: k is good tableId: 108 Status: PUBLIC - IndexName: @@ -439,7 +395,7 @@ ElementState: tableId: 108 Status: PUBLIC - IndexComment: - comment: __placeholder_comment__ + comment: pkey is good indexId: 1 tableId: 108 Status: PUBLIC diff --git a/pkg/ccl/schemachangerccl/testdata/decomp/partitioning b/pkg/ccl/schemachangerccl/testdata/decomp/partitioning index 1670ac80a40e..b4b339ecde01 100644 --- a/pkg/ccl/schemachangerccl/testdata/decomp/partitioning +++ b/pkg/ccl/schemachangerccl/testdata/decomp/partitioning @@ -73,10 +73,6 @@ ElementState: - 1 tableId: 104 Status: PUBLIC -- TableComment: - comment: __placeholder_comment__ - tableId: 104 - Status: PUBLIC - ColumnName: columnId: 1 name: pk @@ -119,21 +115,6 @@ ElementState: isNullable: true tableId: 104 Status: PUBLIC -- ColumnComment: - columnId: 1 - comment: __placeholder_comment__ - tableId: 104 - Status: PUBLIC -- ColumnComment: - columnId: 2 - comment: __placeholder_comment__ - tableId: 104 - Status: PUBLIC -- ColumnComment: - columnId: 3 - comment: __placeholder_comment__ - tableId: 104 - Status: PUBLIC - IndexName: indexId: 1 name: table_implicit_pkey @@ -168,16 +149,6 @@ ElementState: numImplicitColumns: 1 tableId: 104 Status: PUBLIC -- IndexComment: - comment: __placeholder_comment__ - indexId: 1 - tableId: 104 - Status: PUBLIC -- IndexComment: - comment: __placeholder_comment__ - indexId: 2 - tableId: 104 - Status: PUBLIC - Namespace: databaseId: 100 descriptorId: 104 @@ -247,10 +218,6 @@ ElementState: - 1 tableId: 105 Status: PUBLIC -- TableComment: - comment: __placeholder_comment__ - tableId: 105 - Status: PUBLIC - ColumnName: columnId: 1 name: a @@ -280,16 +247,6 @@ ElementState: isNullable: true tableId: 105 Status: PUBLIC -- ColumnComment: - columnId: 1 - comment: __placeholder_comment__ - tableId: 105 - Status: PUBLIC -- ColumnComment: - columnId: 2 - comment: __placeholder_comment__ - tableId: 105 - Status: PUBLIC - IndexName: indexId: 1 name: table_partitioned_index_pkey @@ -311,16 +268,6 @@ ElementState: numColumns: 1 tableId: 105 Status: PUBLIC -- IndexComment: - comment: __placeholder_comment__ - indexId: 1 - tableId: 105 - Status: PUBLIC -- IndexComment: - comment: __placeholder_comment__ - indexId: 2 - tableId: 105 - Status: PUBLIC - Namespace: databaseId: 100 descriptorId: 105 diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion index 9e7326f0527e..ccad035027f2 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_multiregion @@ -3,6 +3,10 @@ CREATE DATABASE multi_region_test_db PRIMARY REGION "us-east1" REGIONS "us-east2 CREATE TABLE multi_region_test_db.public.table_regional_by_row ( k INT PRIMARY KEY ) LOCALITY REGIONAL BY ROW; +COMMENT ON DATABASE multi_region_test_db IS 'multi region db is good'; +COMMENT ON TABLE multi_region_test_db.public.table_regional_by_row IS 'regional by row is good'; +COMMENT ON COLUMN multi_region_test_db.public.table_regional_by_row.k IS 'k is good'; +COMMENT ON INDEX multi_region_test_db.public.table_regional_by_row@table_regional_by_row_pkey IS 'pkey is good'; ---- ... +database {0 0 multi_region_test_db} -> 104 @@ -85,7 +89,6 @@ upsert descriptor #108 + - ABSENT + - ABSENT + - ABSENT - + - ABSENT + - VALIDATED + - ABSENT + - ABSENT @@ -180,7 +183,7 @@ upsert descriptor #108 + targetStatus: ABSENT + - elementProto: + tableComment: - + comment: __placeholder_comment__ + + comment: regional by row is good + tableId: 108 + metadata: + sourceElementId: 1 @@ -228,7 +231,7 @@ upsert descriptor #108 + - elementProto: + columnComment: + columnId: 1 - + comment: __placeholder_comment__ + + comment: k is good + tableId: 108 + metadata: + sourceElementId: 1 @@ -284,15 +287,6 @@ upsert descriptor #108 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 108 - + metadata: - + sourceElementId: 1 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + primaryIndex: + embeddedIndex: + indexId: 1 @@ -343,7 +337,7 @@ upsert descriptor #108 + targetStatus: ABSENT + - elementProto: + indexComment: - + comment: __placeholder_comment__ + + comment: pkey is good + indexId: 1 + tableId: 108 + metadata: @@ -424,7 +418,6 @@ upsert descriptor #108 - - ABSENT - - ABSENT - - ABSENT - - - ABSENT - - VALIDATED - - ABSENT - - ABSENT @@ -519,7 +512,7 @@ upsert descriptor #108 - targetStatus: ABSENT - - elementProto: - tableComment: - - comment: __placeholder_comment__ + - comment: regional by row is good - tableId: 108 - metadata: - sourceElementId: 1 @@ -567,7 +560,7 @@ upsert descriptor #108 - - elementProto: - columnComment: - columnId: 1 - - comment: __placeholder_comment__ + - comment: k is good - tableId: 108 - metadata: - sourceElementId: 1 @@ -623,15 +616,6 @@ upsert descriptor #108 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 2 - - comment: __placeholder_comment__ - - tableId: 108 - - metadata: - - sourceElementId: 1 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - primaryIndex: - embeddedIndex: - indexId: 1 @@ -682,7 +666,7 @@ upsert descriptor #108 - targetStatus: ABSENT - - elementProto: - indexComment: - - comment: __placeholder_comment__ + - comment: pkey is good - indexId: 1 - tableId: 108 - metadata: @@ -758,14 +742,11 @@ upsert descriptor #109 + - ABSENT + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - VALIDATED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -789,8 +770,6 @@ upsert descriptor #109 + - 11 + - 12 + - 13 - + - 14 - + - 15 + targets: + - elementProto: + namespace: @@ -853,14 +832,6 @@ upsert descriptor #109 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 109 - + metadata: - + sourceElementId: 1 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + columnFamily: + name: primary + tableId: 109 @@ -900,15 +871,6 @@ upsert descriptor #109 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 109 - + metadata: - + sourceElementId: 1 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + primaryIndex: + embeddedIndex: + indexId: 1 @@ -931,15 +893,6 @@ upsert descriptor #109 + sourceElementId: 1 + subWorkId: 1 + targetStatus: ABSENT - + - elementProto: - + indexComment: - + comment: __placeholder_comment__ - + indexId: 1 - + tableId: 109 - + metadata: - + sourceElementId: 1 - + subWorkId: 1 - + targetStatus: ABSENT + dropTime: " families: - columnIds: @@ -990,14 +943,11 @@ upsert descriptor #109 - - ABSENT - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - VALIDATED - - ABSENT - - - ABSENT - jobId: "1" - relevantStatements: - - statement: @@ -1021,8 +971,6 @@ upsert descriptor #109 - - 11 - - 12 - - 13 - - - 14 - - - 15 - targets: - - elementProto: - namespace: @@ -1085,14 +1033,6 @@ upsert descriptor #109 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - tableComment: - - comment: __placeholder_comment__ - - tableId: 109 - - metadata: - - sourceElementId: 1 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - columnFamily: - name: primary - tableId: 109 @@ -1132,15 +1072,6 @@ upsert descriptor #109 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 1 - - comment: __placeholder_comment__ - - tableId: 109 - - metadata: - - sourceElementId: 1 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - primaryIndex: - embeddedIndex: - indexId: 1 @@ -1162,15 +1093,6 @@ upsert descriptor #109 - metadata: - sourceElementId: 1 - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - - indexComment: - - comment: __placeholder_comment__ - - indexId: 1 - - tableId: 109 - - metadata: - - sourceElementId: 1 - - subWorkId: 1 - targetStatus: ABSENT dropTime: " families: @@ -1196,7 +1118,7 @@ begin transaction #1 ## StatementPhase stage 1 of 1 with 4 MutationType ops # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 18 MutationType ops +## PreCommitPhase stage 1 of 1 with 17 MutationType ops delete database namespace entry {0 0 multi_region_test_db} -> 104 delete object namespace entry {104 106 crdb_internal_region} -> 105 delete schema namespace entry {104 0 public} -> 106 @@ -1293,7 +1215,7 @@ upsert descriptor #104 + targetStatus: ABSENT + - elementProto: + databaseComment: - + comment: __placeholder_comment__ + + comment: multi region db is good + databaseId: 104 + metadata: + sourceElementId: 1 @@ -1336,13 +1258,13 @@ upsert descriptor #105 + statement: DROP DATABASE multi_region_test_db CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 + - 22 - + - 23 + targets: + - elementProto: + namespace: @@ -1427,7 +1349,6 @@ upsert descriptor #106 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -1442,7 +1363,6 @@ upsert descriptor #106 + - 13 + - 14 + - 15 - + - 16 + targets: + - elementProto: + namespace: @@ -1503,14 +1423,6 @@ upsert descriptor #106 + metadata: + sourceElementId: 2 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + schemaComment: - + comment: __placeholder_comment__ - + schemaId: 106 - + metadata: - + sourceElementId: 2 - + subWorkId: 1 + targetStatus: ABSENT id: 106 modificationTime: {} @@ -1542,13 +1454,13 @@ upsert descriptor #107 + statement: DROP DATABASE multi_region_test_db CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 23 + - 24 + - 25 + - 26 + - 27 + - 28 + - 29 - + - 30 + targets: + - elementProto: + namespace: @@ -1632,7 +1544,6 @@ upsert descriptor #107 + state: DROP + version: "5" delete comment for descriptor #104 of type DatabaseCommentType -delete comment for descriptor #106 of type SchemaCommentType delete role settings for database on #104 create job #1 (non-cancelable: true): "DROP DATABASE multi_region_test_db CASCADE" descriptor IDs: [104 105 106 107] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic index ffdb70c97493..5a469290d3ca 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: > is_nullable:true is_relation_being_dropped:true > > 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: > is_relation_being_dropped:true > > 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:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY 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 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:"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: > is_relation_being_dropped:true > > 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 > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:WRITE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:VALIDATED 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 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/builder_test.go b/pkg/sql/schemachanger/scbuild/builder_test.go index e90de146a0d8..051013ef4d6e 100644 --- a/pkg/sql/schemachanger/scbuild/builder_test.go +++ b/pkg/sql/schemachanger/scbuild/builder_test.go @@ -143,7 +143,7 @@ func run( } return "" - case "descriptor-metadata": + case "setup": stmts, err := parser.Parse(d.Input) require.NoError(t, err) for _, stmt := range stmts { diff --git a/pkg/sql/schemachanger/scbuild/testdata/comment_on b/pkg/sql/schemachanger/scbuild/testdata/comment_on new file mode 100644 index 000000000000..6b3a4dc85c11 --- /dev/null +++ b/pkg/sql/schemachanger/scbuild/testdata/comment_on @@ -0,0 +1,212 @@ +create-table +CREATE TABLE customer ( + id INT PRIMARY KEY, + name STRING NOT NULL, + age INT NOT NULL, + INDEX idx_customer_name(name), + CONSTRAINT customer_age_gt_21 CHECk (age > 10) +); +---- + +build +COMMENT ON DATABASE defaultdb IS 'defaultdb is good'; +---- +- [[DatabaseComment:{DescID: 100, Comment: defaultdb is good}, PUBLIC], ABSENT] + details: + comment: defaultdb is good + databaseId: 100 + +setup +COMMENT ON DATABASE defaultdb IS 'defaultdb real comment'; +---- + +build +COMMENT ON DATABASE defaultdb IS 'defaultdb is better'; +---- +- [[DatabaseComment:{DescID: 100, Comment: defaultdb is better}, PUBLIC], ABSENT] + details: + comment: defaultdb is better + databaseId: 100 + +build +COMMENT ON DATABASE defaultdb IS NULL; +---- +- [[DatabaseComment:{DescID: 100, Comment: defaultdb real comment}, ABSENT], PUBLIC] + details: + comment: defaultdb real comment + databaseId: 100 + +create-schema +CREATE SCHEMA test_schema; +---- + +setup +COMMENT ON SCHEMA test_schema IS 'public schema real comment'; +---- + +build +COMMENT ON SCHEMA test_schema IS 'public schema is good'; +---- +- [[SchemaComment:{DescID: 105, Comment: public schema is good}, PUBLIC], ABSENT] + details: + comment: public schema is good + schemaId: 105 + +setup +COMMENT ON SCHEMA test_schema IS 'public schema real comment'; +---- + +build +COMMENT ON SCHEMA test_schema IS 'public schema is better'; +---- +- [[SchemaComment:{DescID: 105, Comment: public schema is better}, PUBLIC], ABSENT] + details: + comment: public schema is better + schemaId: 105 + +build +COMMENT ON SCHEMA test_schema IS NULL; +---- +- [[SchemaComment:{DescID: 105, Comment: public schema real comment}, ABSENT], PUBLIC] + details: + comment: public schema real comment + schemaId: 105 + +build +COMMENT ON TABLE customer IS 'customer is god'; +---- +- [[TableComment:{DescID: 104, Comment: customer is god}, PUBLIC], ABSENT] + details: + comment: customer is god + tableId: 104 + +setup +COMMENT ON TABLE customer IS 'customer real comment'; +---- + +build +COMMENT ON TABLE customer IS 'customer gets better'; +---- +- [[TableComment:{DescID: 104, Comment: customer gets better}, PUBLIC], ABSENT] + details: + comment: customer gets better + tableId: 104 + +build +COMMENT ON TABLE customer IS NULL; +---- +- [[TableComment:{DescID: 104, Comment: customer real comment}, ABSENT], PUBLIC] + details: + comment: customer real comment + tableId: 104 + +build +COMMENT ON COLUMN customer.name IS 'some comment for name'; +---- +- [[ColumnComment:{DescID: 104, ColumnID: 2, Comment: some comment for name}, PUBLIC], ABSENT] + details: + columnId: 2 + comment: some comment for name + tableId: 104 + +setup +COMMENT ON COLUMN customer.name IS 'real comment for name'; +---- + +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] + details: + columnId: 2 + comment: some better comment for name + tableId: 104 + +build +COMMENT ON COLUMN customer.name IS NULL; +---- +- [[ColumnComment:{DescID: 104, ColumnID: 2, Comment: real comment for name}, ABSENT], PUBLIC] + details: + columnId: 2 + comment: real comment for name + tableId: 104 + +build +COMMENT ON INDEX idx_customer_name IS 'comment on name index'; +---- +- [[IndexComment:{DescID: 104, IndexID: 2, Comment: comment on name index}, PUBLIC], ABSENT] + details: + comment: comment on name index + indexId: 2 + tableId: 104 + +setup +COMMENT ON INDEX idx_customer_name IS 'real comment on name index'; +---- + +build +COMMENT ON INDEX idx_customer_name IS 'better comment for name index'; +---- +- [[IndexComment:{DescID: 104, IndexID: 2, Comment: better comment for name index}, PUBLIC], ABSENT] + details: + comment: better comment for name index + indexId: 2 + tableId: 104 + +build +COMMENT ON INDEX idx_customer_name IS NULL; +---- +- [[IndexComment:{DescID: 104, IndexID: 2, Comment: real comment on name index}, ABSENT], PUBLIC] + details: + comment: real comment on name index + indexId: 2 + tableId: 104 + +build +COMMENT ON INDEX customer@idx_customer_name IS 'better comment for name index' +---- +- [[IndexComment:{DescID: 104, IndexID: 2, Comment: better comment for name index}, PUBLIC], ABSENT] + details: + comment: better comment for name index + indexId: 2 + tableId: 104 + +build +COMMENT ON INDEX customer@idx_customer_name IS NULL; +---- +- [[IndexComment:{DescID: 104, IndexID: 2, Comment: real comment on name index}, ABSENT], PUBLIC] + details: + comment: real comment on name index + indexId: 2 + tableId: 104 + +build +COMMENT ON CONSTRAINT customer_age_gt_21 ON customer IS 'better be old enough' +---- +- [[ConstraintComment:{DescID: 104, ConstraintID: 2, Comment: better be old enough}, PUBLIC], ABSENT] + details: + comment: better be old enough + constraintId: 2 + tableId: 104 + +setup +COMMENT ON CONSTRAINT customer_age_gt_21 ON customer IS 'real constraint comment' +---- + +build +COMMENT ON CONSTRAINT customer_age_gt_21 ON customer IS 'better be old enough' +---- +- [[ConstraintComment:{DescID: 104, ConstraintID: 2, Comment: better be old enough}, PUBLIC], ABSENT] + details: + comment: better be old enough + constraintId: 2 + tableId: 104 + +build +COMMENT ON CONSTRAINT customer_age_gt_21 ON customer IS NULL +---- +- [[ConstraintComment:{DescID: 104, ConstraintID: 2, Comment: real constraint comment}, ABSENT], PUBLIC] + details: + comment: real constraint comment + constraintId: 2 + tableId: 104 diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_database b/pkg/sql/schemachanger/scbuild/testdata/drop_database index 326496b0376f..1f29be97c571 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_database +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_database @@ -46,6 +46,14 @@ create-view CREATE VIEW db1.sc1.v5 AS (SELECT 'a'::db1.sc1.typ::string AS k, n2, n1 from db1.sc1.v4) ---- +setup +COMMENT ON DATABASE db1 IS 'db1 is good'; +COMMENT ON SCHEMA db1.sc1 IS 'sc1 is good'; +COMMENT ON TABLE db1.sc1.t1 IS 't1 is good'; +COMMENT ON COLUMN db1.sc1.t1.id IS 'id is good'; +COMMENT ON INDEX db1.sc1.t1@t1_pkey IS 't1_pkey is good'; +---- + build DROP DATABASE db1 CASCADE ---- @@ -129,86 +137,11 @@ DROP DATABASE db1 CASCADE details: columnId: 3 tableId: 117 -- [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] +- [[ColumnComment:{DescID: 109, ColumnID: 1, Comment: id is good}, ABSENT], PUBLIC] details: columnId: 1 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ + comment: id is good tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 110 -- [[ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 110 -- [[ColumnComment:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ - tableId: 110 -- [[ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 111 -- [[ColumnComment:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 112 -- [[ColumnComment:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 112 -- [[ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 113 -- [[ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 113 -- [[ColumnComment:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 114 -- [[ColumnComment:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 114 -- [[ColumnComment:{DescID: 117, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 117 -- [[ColumnComment:{DescID: 117, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 117 -- [[ColumnComment:{DescID: 117, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ - tableId: 117 - [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 @@ -500,9 +433,9 @@ DROP DATABASE db1 CASCADE - [[Database:{DescID: 104}, ABSENT], PUBLIC] details: databaseId: 104 -- [[DatabaseComment:{DescID: 104}, ABSENT], PUBLIC] +- [[DatabaseComment:{DescID: 104, Comment: db1 is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: db1 is good databaseId: 104 - [[DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__}, ABSENT], PUBLIC] details: @@ -512,16 +445,11 @@ DROP DATABASE db1 CASCADE details: arrayTypeId: 116 typeId: 115 -- [[IndexComment:{DescID: 109, IndexID: 1}, ABSENT], PUBLIC] +- [[IndexComment:{DescID: 109, IndexID: 1, Comment: t1_pkey is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: t1_pkey is good indexId: 1 tableId: 109 -- [[IndexComment:{DescID: 110, IndexID: 1}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - indexId: 1 - tableId: 110 - [[IndexName:{DescID: 109, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] details: indexId: 1 @@ -745,13 +673,9 @@ DROP DATABASE db1 CASCADE - [[Schema:{DescID: 106}, ABSENT], PUBLIC] details: schemaId: 106 -- [[SchemaComment:{DescID: 105}, ABSENT], PUBLIC] +- [[SchemaComment:{DescID: 106, Comment: sc1 is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ - schemaId: 105 -- [[SchemaComment:{DescID: 106}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ + comment: sc1 is good schemaId: 106 - [[SchemaParent:{DescID: 105, ReferencedDescID: 104}, ABSENT], PUBLIC] details: @@ -773,42 +697,10 @@ DROP DATABASE db1 CASCADE - [[Table:{DescID: 110}, ABSENT], PUBLIC] details: tableId: 110 -- [[TableComment:{DescID: 107}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 107 -- [[TableComment:{DescID: 108}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 108 -- [[TableComment:{DescID: 109}, ABSENT], PUBLIC] +- [[TableComment:{DescID: 109, Comment: t1 is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: t1 is good tableId: 109 -- [[TableComment:{DescID: 110}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 110 -- [[TableComment:{DescID: 111}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 111 -- [[TableComment:{DescID: 112}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 112 -- [[TableComment:{DescID: 113}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 113 -- [[TableComment:{DescID: 114}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 114 -- [[TableComment:{DescID: 117}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 117 - [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 104 diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_schema b/pkg/sql/schemachanger/scbuild/testdata/drop_schema index dcb169b60c68..4c07c0e44768 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_schema +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_schema @@ -42,6 +42,13 @@ create-view CREATE VIEW sc2.v6 AS (SELECT 'a'::sc1.typ::string AS k, n2, n1 from sc1.v4) ---- +setup +COMMENT ON SCHEMA sc1 IS 'sc1 is good'; +COMMENT ON TABLE sc1.t1 IS 't1 is good'; +COMMENT ON COLUMN sc1.t1.id IS 'id is good'; +COMMENT ON INDEX sc1.t1@t1_pkey IS 't1_pkey is good'; +---- + build DROP SCHEMA defaultdb.SC1 CASCADE ---- @@ -125,86 +132,11 @@ DROP SCHEMA defaultdb.SC1 CASCADE details: columnId: 3 tableId: 115 -- [[ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] +- [[ColumnComment:{DescID: 107, ColumnID: 1, Comment: id is good}, ABSENT], PUBLIC] details: columnId: 1 - comment: __placeholder_comment__ - tableId: 107 -- [[ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 107 -- [[ColumnComment:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ + comment: id is good tableId: 107 -- [[ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 108 -- [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 110 -- [[ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 110 -- [[ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 111 -- [[ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 111 -- [[ColumnComment:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 114 -- [[ColumnComment:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 114 -- [[ColumnComment:{DescID: 114, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ - tableId: 114 -- [[ColumnComment:{DescID: 115, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 115 -- [[ColumnComment:{DescID: 115, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 115 -- [[ColumnComment:{DescID: 115, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ - tableId: 115 - [[ColumnDefaultExpression:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] details: columnId: 3 @@ -486,9 +418,9 @@ DROP SCHEMA defaultdb.SC1 CASCADE details: arrayTypeId: 113 typeId: 112 -- [[IndexComment:{DescID: 107, IndexID: 1}, ABSENT], PUBLIC] +- [[IndexComment:{DescID: 107, IndexID: 1, Comment: t1_pkey is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: t1_pkey is good indexId: 1 tableId: 107 - [[IndexName:{DescID: 107, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] @@ -661,9 +593,9 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[Schema:{DescID: 104}, ABSENT], PUBLIC] details: schemaId: 104 -- [[SchemaComment:{DescID: 104}, ABSENT], PUBLIC] +- [[SchemaComment:{DescID: 104, Comment: sc1 is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: sc1 is good schemaId: 104 - [[SchemaParent:{DescID: 104, ReferencedDescID: 100}, ABSENT], PUBLIC] details: @@ -675,38 +607,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE - [[Table:{DescID: 107}, ABSENT], PUBLIC] details: tableId: 107 -- [[TableComment:{DescID: 106}, ABSENT], PUBLIC] +- [[TableComment:{DescID: 107, Comment: t1 is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ - tableId: 106 -- [[TableComment:{DescID: 107}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ + comment: t1 is good tableId: 107 -- [[TableComment:{DescID: 108}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 108 -- [[TableComment:{DescID: 109}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 109 -- [[TableComment:{DescID: 110}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 110 -- [[TableComment:{DescID: 111}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 111 -- [[TableComment:{DescID: 114}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 114 -- [[TableComment:{DescID: 115}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 115 - [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 104 diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_sequence b/pkg/sql/schemachanger/scbuild/testdata/drop_sequence index 776a8c07a382..c540ba03425a 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_sequence +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_sequence @@ -22,10 +22,6 @@ DROP SEQUENCE defaultdb.SQ1 CASCADE - [[Sequence:{DescID: 104}, ABSENT], PUBLIC] details: sequenceId: 104 -- [[TableComment:{DescID: 104}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 104 - [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 104 @@ -100,10 +96,6 @@ DROP SEQUENCE defaultdb.SQ1 CASCADE - [[Sequence:{DescID: 104}, ABSENT], PUBLIC] details: sequenceId: 104 -- [[TableComment:{DescID: 104}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 104 - [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 104 @@ -148,10 +140,6 @@ DROP SEQUENCE defaultdb.ownedseq CASCADE columnId: 1 sequenceId: 111 tableId: 110 -- [[TableComment:{DescID: 111}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 111 - [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 111 diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_table b/pkg/sql/schemachanger/scbuild/testdata/drop_table index deae7b365f8e..075e7f9eebb6 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_table +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_table @@ -40,6 +40,13 @@ create-view CREATE VIEW v1 as (select customer_id, carrier from defaultdb.shipments); ---- +setup +COMMENT ON TABLE defaultdb.shipments IS 'shipment is important'; +COMMENT ON COLUMN defaultdb.shipments.tracking_number IS 'tracking_number is good'; +COMMENT ON INDEX defaultdb.shipments@shipments_pkey IS 'pkey is good'; +COMMENT ON CONSTRAINT fk_customers ON defaultdb.shipments IS 'customer is important'; +---- + build DROP TABLE defaultdb.shipments CASCADE; ---- @@ -75,46 +82,11 @@ DROP TABLE defaultdb.shipments CASCADE; details: columnId: 2 tableId: 111 -- [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] +- [[ColumnComment:{DescID: 109, ColumnID: 1, Comment: tracking_number is good}, ABSENT], PUBLIC] details: columnId: 1 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ + comment: tracking_number is good tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 4}, ABSENT], PUBLIC] - details: - columnId: 4 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 5}, ABSENT], PUBLIC] - details: - columnId: 5 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 109, ColumnID: 6}, ABSENT], PUBLIC] - details: - columnId: 6 - comment: __placeholder_comment__ - tableId: 109 -- [[ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 111 -- [[ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 111 - [[ColumnDefaultExpression:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 @@ -265,16 +237,11 @@ DROP TABLE defaultdb.shipments CASCADE; isNullable: true isRelationBeingDropped: true tableId: 111 -- [[ConstraintComment:{DescID: 109, ConstraintID: 2}, ABSENT], PUBLIC] +- [[ConstraintComment:{DescID: 109, ConstraintID: 2, Comment: customer is important}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: customer is important constraintId: 2 tableId: 109 -- [[ConstraintComment:{DescID: 109, ConstraintID: 3}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - constraintId: 3 - tableId: 109 - [[ConstraintName:{DescID: 109, Name: fk_customers, ConstraintID: 2}, ABSENT], PUBLIC] details: constraintId: 2 @@ -303,9 +270,9 @@ DROP TABLE defaultdb.shipments CASCADE; - 2 referencedTableId: 105 tableId: 109 -- [[IndexComment:{DescID: 109, IndexID: 1}, ABSENT], PUBLIC] +- [[IndexComment:{DescID: 109, IndexID: 1, Comment: pkey is good}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: pkey is good indexId: 1 tableId: 109 - [[IndexName:{DescID: 109, Name: shipments_pkey, IndexID: 1}, ABSENT], PUBLIC] @@ -382,18 +349,10 @@ DROP TABLE defaultdb.shipments CASCADE; - [[Table:{DescID: 109}, ABSENT], PUBLIC] details: tableId: 109 -- [[TableComment:{DescID: 109}, ABSENT], PUBLIC] +- [[TableComment:{DescID: 109, Comment: shipment is important}, ABSENT], PUBLIC] details: - comment: __placeholder_comment__ + comment: shipment is important tableId: 109 -- [[TableComment:{DescID: 110}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 110 -- [[TableComment:{DescID: 111}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 111 - [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 109 diff --git a/pkg/sql/schemachanger/scbuild/testdata/drop_view b/pkg/sql/schemachanger/scbuild/testdata/drop_view index 67e8dc5ec794..1ff08dc1cdb9 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/drop_view +++ b/pkg/sql/schemachanger/scbuild/testdata/drop_view @@ -13,11 +13,6 @@ DROP VIEW defaultdb.v1 details: columnId: 1 tableId: 105 -- [[ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 105 - [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 @@ -49,10 +44,6 @@ DROP VIEW defaultdb.v1 details: descriptorId: 105 owner: root -- [[TableComment:{DescID: 105}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 105 - [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 105 @@ -132,56 +123,6 @@ DROP VIEW defaultdb.v1 CASCADE details: columnId: 3 tableId: 111 -- [[ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 105 -- [[ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 106 -- [[ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 106 -- [[ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 107 -- [[ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 107 -- [[ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 108 -- [[ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 108 -- [[ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] - details: - columnId: 1 - comment: __placeholder_comment__ - tableId: 111 -- [[ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] - details: - columnId: 2 - comment: __placeholder_comment__ - tableId: 111 -- [[ColumnComment:{DescID: 111, ColumnID: 3}, ABSENT], PUBLIC] - details: - columnId: 3 - comment: __placeholder_comment__ - tableId: 111 - [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] details: columnId: 1 @@ -420,26 +361,6 @@ DROP VIEW defaultdb.v1 CASCADE details: descriptorId: 111 owner: root -- [[TableComment:{DescID: 105}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 105 -- [[TableComment:{DescID: 106}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 106 -- [[TableComment:{DescID: 107}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 107 -- [[TableComment:{DescID: 108}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 108 -- [[TableComment:{DescID: 111}, ABSENT], PUBLIC] - details: - comment: __placeholder_comment__ - tableId: 111 - [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] details: descriptorId: 105 diff --git a/pkg/sql/schemachanger/scplan/plan_test.go b/pkg/sql/schemachanger/scplan/plan_test.go index 71b54a638013..f7cefcf095e9 100644 --- a/pkg/sql/schemachanger/scplan/plan_test.go +++ b/pkg/sql/schemachanger/scplan/plan_test.go @@ -91,7 +91,7 @@ func TestPlanDataDriven(t *testing.T) { t.Logf("created relation with id %d", tableID) } return "" - case "descriptor-metadata": + case "setup": stmts, err := parser.Parse(d.Input) require.NoError(t, err) for _, stmt := range stmts { diff --git a/pkg/sql/schemachanger/scplan/testdata/comment_on b/pkg/sql/schemachanger/scplan/testdata/comment_on index a65c2c8868de..c99aff4385ab 100644 --- a/pkg/sql/schemachanger/scplan/testdata/comment_on +++ b/pkg/sql/schemachanger/scplan/testdata/comment_on @@ -83,7 +83,7 @@ StatementPhase stage 1 of 1 with 1 MutationType ops ConstraintID: 2 TableID: 107 -descriptor-metadata +setup COMMENT ON DATABASE db1 IS 'db1 is good'; COMMENT ON SCHEMA db1.sc1 IS 'sc1 is good'; COMMENT ON TABLE db1.sc1.t1 IS 't1 is good'; diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_database b/pkg/sql/schemachanger/scplan/testdata/drop_database index d948a684b0b4..cb66336e881f 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_database +++ b/pkg/sql/schemachanger/scplan/testdata/drop_database @@ -46,6 +46,12 @@ create-view CREATE VIEW db1.sc1.v5 AS (SELECT 'a'::db1.sc1.typ::string AS k, n2, n1 from db1.sc1.v4) ---- +setup +COMMENT ON DATABASE db1 IS 'db1 is good'; +COMMENT ON SCHEMA db1.sc1 IS 'sc1 is good'; +COMMENT ON TABLE db1.sc1.t1 IS 't1 is good'; +---- + ops DROP DATABASE db1 CASCADE ---- @@ -94,7 +100,7 @@ StatementPhase stage 1 of 1 with 14 MutationType ops DescID: 116 *scop.MarkDescriptorAsDroppedSynthetically DescID: 117 -PreCommitPhase stage 1 of 1 with 84 MutationType ops +PreCommitPhase stage 1 of 1 with 83 MutationType ops transitions: [[Namespace:{DescID: 104, Name: db1, ReferencedDescID: 0}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -103,7 +109,7 @@ PreCommitPhase stage 1 of 1 with 84 MutationType ops [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Database:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__}, ABSENT], PUBLIC] -> ABSENT - [[DatabaseComment:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[DatabaseComment:{DescID: 104, Comment: db1 is good}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 105, Name: public, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT @@ -111,132 +117,109 @@ PreCommitPhase stage 1 of 1 with 84 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Schema:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 105, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[SchemaComment:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: sc1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Schema:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 106, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[SchemaComment:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[SchemaComment:{DescID: 106, Comment: sc1 is good}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: sq1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Sequence:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: t1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Table:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 110, ColumnFamilyID: 0, Name: primary}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 110, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 110, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 110, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 110, IndexID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 110, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[IndexComment:{DescID: 110, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: sq1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Sequence:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: t1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Table:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT + [[TableComment:{DescID: 109, Comment: t1 is good}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, ColumnFamilyID: 0, Name: primary}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 109, IndexID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 109, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[IndexComment:{DescID: 109, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 111, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 112, Name: v2, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 112}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 112}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 112, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 112, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 113, Name: v3, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 113}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 113}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 113, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 113, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 114, Name: v4, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 114}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 114, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 114, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 114}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 114, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 114, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 115, Name: typ, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 115}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 115, Name: admin}, ABSENT], PUBLIC] -> ABSENT @@ -257,19 +240,15 @@ PreCommitPhase stage 1 of 1 with 84 MutationType ops [[UserPrivileges:{DescID: 117, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 117}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 117, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 117}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 117, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 117, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 117, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 117, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 117, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 117, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 117, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 117, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 117, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: @@ -288,8 +267,6 @@ PreCommitPhase stage 1 of 1 with 84 MutationType ops Parent: ParentDatabaseID: 104 SchemaID: 105 - *scop.RemoveSchemaComment - SchemaID: 105 *scop.DrainDescriptorName Namespace: DatabaseID: 104 @@ -942,10 +919,6 @@ DROP DATABASE db1 CASCADE to: [EnumType:{DescID: 115}, DROPPED] kind: SameStagePrecedence rule: array type drops right before its element enum type -- from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT] kind: Precedence @@ -954,10 +927,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT] kind: Precedence @@ -966,10 +935,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 109, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT] kind: Precedence @@ -978,10 +943,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 110, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 110, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 110, Name: id, ColumnID: 1}, ABSENT] kind: Precedence @@ -990,10 +951,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 110, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 110, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 110, Name: name, ColumnID: 2}, ABSENT] kind: Precedence @@ -1002,10 +959,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 110, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 110, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 110, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 110, Name: val, ColumnID: 3}, ABSENT] kind: Precedence @@ -1014,10 +967,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 111, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 111, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 111, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -1026,10 +975,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 112, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 112, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 112, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 112, Name: n1, ColumnID: 1}, ABSENT] kind: Precedence @@ -1038,10 +983,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 112, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 112, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 112, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 112, Name: n2, ColumnID: 2}, ABSENT] kind: Precedence @@ -1050,10 +991,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 113, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 113, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 113, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -1062,10 +999,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 113, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 113, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 113, Name: n1, ColumnID: 2}, ABSENT] kind: Precedence @@ -1074,10 +1007,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 114, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 114, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 114, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 114, Name: n2, ColumnID: 1}, ABSENT] kind: Precedence @@ -1086,10 +1015,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 114, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 114, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 114, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 114, Name: n1, ColumnID: 2}, ABSENT] kind: Precedence @@ -1098,10 +1023,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 117, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 117, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 117, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 117, Name: k, ColumnID: 1}, ABSENT] kind: Precedence @@ -1110,10 +1031,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 117, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 117, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 117, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 117, Name: n2, ColumnID: 2}, ABSENT] kind: Precedence @@ -1122,10 +1039,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 117, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 117, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 117, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 117, Name: n1, ColumnID: 3}, ABSENT] kind: Precedence @@ -1134,134 +1047,6 @@ DROP DATABASE db1 CASCADE to: [ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - to: [Table:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - to: [Table:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 109, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 3}, ABSENT] - to: [Table:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 110, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT] - to: [Table:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 110, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT] - to: [Table:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 110, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 110, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 110, ColumnID: 3}, ABSENT] - to: [Table:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 111, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT] - to: [View:{DescID: 111}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 112, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 112, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 112, ColumnID: 1}, ABSENT] - to: [View:{DescID: 112}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 112, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 112, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 112, ColumnID: 2}, ABSENT] - to: [View:{DescID: 112}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 113, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 113, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 114, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 114, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 114, ColumnID: 1}, ABSENT] - to: [View:{DescID: 114}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 114, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 114, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 114, ColumnID: 2}, ABSENT] - to: [View:{DescID: 114}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 117, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 117, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 117, ColumnID: 1}, ABSENT] - to: [View:{DescID: 117}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 117, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 117, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 117, ColumnID: 2}, ABSENT] - to: [View:{DescID: 117}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 117, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 117, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 117, ColumnID: 3}, ABSENT] - to: [View:{DescID: 117}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT] to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: SameStagePrecedence @@ -1486,7 +1271,7 @@ DROP DATABASE db1 CASCADE to: [Column:{DescID: 117, ColumnID: 3}, ABSENT] kind: Precedence rule: dependents removed before column -- from: [DatabaseComment:{DescID: 104}, ABSENT] +- from: [DatabaseComment:{DescID: 104, Comment: db1 is good}, ABSENT] to: [Database:{DescID: 104}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop @@ -1494,22 +1279,6 @@ DROP DATABASE db1 CASCADE to: [Database:{DescID: 104}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [IndexComment:{DescID: 109, IndexID: 1}, ABSENT] - to: [PrimaryIndex:{DescID: 109, IndexID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before index -- from: [IndexComment:{DescID: 109, IndexID: 1}, ABSENT] - to: [Table:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [IndexComment:{DescID: 110, IndexID: 1}, ABSENT] - to: [PrimaryIndex:{DescID: 110, IndexID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before index -- from: [IndexComment:{DescID: 110, IndexID: 1}, ABSENT] - to: [Table:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [IndexName:{DescID: 109, Name: t1_pkey, IndexID: 1}, ABSENT] to: [PrimaryIndex:{DescID: 109, IndexID: 1}, ABSENT] kind: Precedence @@ -1726,27 +1495,15 @@ DROP DATABASE db1 CASCADE to: [View:{DescID: 117}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [PrimaryIndex:{DescID: 109, IndexID: 1}, VALIDATED] - to: [IndexComment:{DescID: 109, IndexID: 1}, ABSENT] - kind: Precedence - rule: dependents removed after index no longer public - from: [PrimaryIndex:{DescID: 109, IndexID: 1}, VALIDATED] to: [IndexName:{DescID: 109, Name: t1_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: dependents removed after index no longer public -- from: [PrimaryIndex:{DescID: 110, IndexID: 1}, VALIDATED] - to: [IndexComment:{DescID: 110, IndexID: 1}, ABSENT] - kind: Precedence - rule: dependents removed after index no longer public - from: [PrimaryIndex:{DescID: 110, IndexID: 1}, VALIDATED] to: [IndexName:{DescID: 110, Name: t1_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: dependents removed after index no longer public -- from: [SchemaComment:{DescID: 105}, ABSENT] - to: [Schema:{DescID: 105}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [SchemaComment:{DescID: 106}, ABSENT] +- from: [SchemaComment:{DescID: 106, Comment: sc1 is good}, ABSENT] to: [Schema:{DescID: 106}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop @@ -1798,42 +1555,10 @@ DROP DATABASE db1 CASCADE to: [PrimaryIndex:{DescID: 110, IndexID: 1}, ABSENT] kind: SameStagePrecedence rule: dependent element removal right after descriptor removal -- from: [TableComment:{DescID: 107}, ABSENT] - to: [Sequence:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 108}, ABSENT] - to: [Sequence:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 109}, ABSENT] +- from: [TableComment:{DescID: 109, Comment: t1 is good}, ABSENT] to: [Table:{DescID: 109}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 110}, ABSENT] - to: [Table:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 111}, ABSENT] - to: [View:{DescID: 111}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 112}, ABSENT] - to: [View:{DescID: 112}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 113}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 114}, ABSENT] - to: [View:{DescID: 114}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 117}, ABSENT] - to: [View:{DescID: 117}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [UserPrivileges:{DescID: 104, Name: admin}, ABSENT] to: [Database:{DescID: 104}, DROPPED] kind: Precedence diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_schema b/pkg/sql/schemachanger/scplan/testdata/drop_schema index e9c1c7bc2218..46fe34ee16cd 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_schema +++ b/pkg/sql/schemachanger/scplan/testdata/drop_schema @@ -34,6 +34,11 @@ create-view CREATE VIEW sc1.v5 AS (SELECT 'a'::sc1.typ::STRING AS k, n2, n1 FROM sc1.v4) ---- +setup +COMMENT ON SCHEMA sc1 IS 'sc1 is good schema'; +COMMENT ON TABLE sc1.t1 IS 't1 is good table'; +---- + deps DROP SCHEMA defaultdb.SC1 CASCADE ---- @@ -41,10 +46,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [EnumType:{DescID: 111}, DROPPED] kind: SameStagePrecedence rule: array type drops right before its element enum type -- from: [Column:{DescID: 106, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 106, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 106, Name: id, ColumnID: 1}, ABSENT] kind: Precedence @@ -53,10 +54,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 106, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 106, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 106, Name: name, ColumnID: 2}, ABSENT] kind: Precedence @@ -65,10 +62,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 106, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 106, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 106, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 106, Name: val, ColumnID: 3}, ABSENT] kind: Precedence @@ -77,10 +70,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -89,10 +78,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 108, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 108, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 108, Name: n1, ColumnID: 1}, ABSENT] kind: Precedence @@ -101,10 +86,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 108, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 108, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 108, Name: n2, ColumnID: 2}, ABSENT] kind: Precedence @@ -113,10 +94,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -125,10 +102,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: n1, ColumnID: 2}, ABSENT] kind: Precedence @@ -137,10 +110,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 110, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 110, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 110, Name: n2, ColumnID: 1}, ABSENT] kind: Precedence @@ -149,10 +118,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 110, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 110, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 110, Name: n1, ColumnID: 2}, ABSENT] kind: Precedence @@ -161,10 +126,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 113, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 113, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT] kind: Precedence @@ -173,10 +134,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 113, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 113, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 113, Name: n2, ColumnID: 2}, ABSENT] kind: Precedence @@ -185,10 +142,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 113, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 113, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 113, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 113, Name: n1, ColumnID: 3}, ABSENT] kind: Precedence @@ -197,110 +150,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 106, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT] - to: [Table:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 106, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT] - to: [Table:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 106, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 106, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 106, ColumnID: 3}, ABSENT] - to: [Table:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - to: [View:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 108, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT] - to: [View:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 108, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT] - to: [View:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - to: [View:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - to: [View:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 110, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT] - to: [View:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 110, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT] - to: [View:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 113, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 113, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 113, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 113, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 113, ColumnID: 3}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [ColumnDefaultExpression:{DescID: 106, ColumnID: 3}, ABSENT] to: [ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: SameStagePrecedence @@ -473,14 +322,6 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [Column:{DescID: 113, ColumnID: 3}, ABSENT] kind: Precedence rule: dependents removed before column -- from: [IndexComment:{DescID: 106, IndexID: 1}, ABSENT] - to: [PrimaryIndex:{DescID: 106, IndexID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before index -- from: [IndexComment:{DescID: 106, IndexID: 1}, ABSENT] - to: [Table:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [IndexName:{DescID: 106, Name: t1_pkey, IndexID: 1}, ABSENT] to: [PrimaryIndex:{DescID: 106, IndexID: 1}, ABSENT] kind: Precedence @@ -641,15 +482,11 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [View:{DescID: 113}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [PrimaryIndex:{DescID: 106, IndexID: 1}, VALIDATED] - to: [IndexComment:{DescID: 106, IndexID: 1}, ABSENT] - kind: Precedence - rule: dependents removed after index no longer public - from: [PrimaryIndex:{DescID: 106, IndexID: 1}, VALIDATED] to: [IndexName:{DescID: 106, Name: t1_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: dependents removed after index no longer public -- from: [SchemaComment:{DescID: 104}, ABSENT] +- from: [SchemaComment:{DescID: 104, Comment: sc1 is good schema}, ABSENT] to: [Schema:{DescID: 104}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop @@ -673,34 +510,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [PrimaryIndex:{DescID: 106, IndexID: 1}, ABSENT] kind: SameStagePrecedence rule: dependent element removal right after descriptor removal -- from: [TableComment:{DescID: 105}, ABSENT] - to: [Sequence:{DescID: 105}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 106}, ABSENT] +- from: [TableComment:{DescID: 106, Comment: t1 is good table}, ABSENT] to: [Table:{DescID: 106}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 107}, ABSENT] - to: [View:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 108}, ABSENT] - to: [View:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 109}, ABSENT] - to: [View:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 110}, ABSENT] - to: [View:{DescID: 110}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 113}, ABSENT] - to: [View:{DescID: 113}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [UserPrivileges:{DescID: 104, Name: admin}, ABSENT] to: [Schema:{DescID: 104}, DROPPED] kind: Precedence @@ -906,94 +719,78 @@ PreCommitPhase stage 1 of 1 with 62 MutationType ops [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Schema:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 104, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT - [[SchemaComment:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[SchemaComment:{DescID: 104, Comment: sc1 is good schema}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 105, Name: sq1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Sequence:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: t1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Table:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[TableComment:{DescID: 106, Comment: t1 is good table}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 106, ColumnFamilyID: 0, Name: primary}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 106, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 106, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 106, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 106, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 106, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 106, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 106, IndexID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 106, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[IndexComment:{DescID: 106, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: v3, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: v4, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 110, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 110, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT @@ -1014,19 +811,15 @@ PreCommitPhase stage 1 of 1 with 62 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 113}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 113, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 113, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 113, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_sequence b/pkg/sql/schemachanger/scplan/testdata/drop_sequence index 18ee24de51ad..2301c80f0450 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_sequence +++ b/pkg/sql/schemachanger/scplan/testdata/drop_sequence @@ -19,7 +19,6 @@ PreCommitPhase stage 1 of 1 with 5 MutationType ops [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Sequence:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 104, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: @@ -97,7 +96,6 @@ PreCommitPhase stage 1 of 1 with 11 MutationType ops [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Sequence:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 104, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 105, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT ops: @@ -206,10 +204,6 @@ DROP SEQUENCE defaultdb.SQ1 CASCADE to: [Sequence:{DescID: 104}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 104}, ABSENT] - to: [Sequence:{DescID: 104}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [UserPrivileges:{DescID: 104, Name: admin}, ABSENT] to: [Sequence:{DescID: 104}, DROPPED] kind: Precedence diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_table b/pkg/sql/schemachanger/scplan/testdata/drop_table index 52dab667b70e..635faa5a4006 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_table +++ b/pkg/sql/schemachanger/scplan/testdata/drop_table @@ -35,6 +35,13 @@ create-view CREATE VIEW v1 AS (SELECT customer_id, carrier FROM defaultdb.shipments) ---- +setup +COMMENT ON TABLE defaultdb.shipments IS 'shipment is important'; +COMMENT ON COLUMN defaultdb.shipments.tracking_number IS 'tracking_number is a must'; +COMMENT ON INDEX defaultdb.shipments@shipments_pkey IS 'pkey is good'; +COMMENT ON CONSTRAINT fk_customers ON defaultdb.shipments IS 'customer is not god'; +---- + ops DROP TABLE defaultdb.shipments CASCADE; ---- @@ -58,62 +65,53 @@ PreCommitPhase stage 1 of 1 with 33 MutationType ops [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Table:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT + [[TableComment:{DescID: 107, Comment: shipment is important}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 107, ColumnFamilyID: 0, Name: primary}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: tracking_number, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[ColumnComment:{DescID: 107, ColumnID: 1, Comment: tracking_number is a must}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[SequenceOwner:{DescID: 107, ColumnID: 2, ReferencedDescID: 108}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: status, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 4}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: customer_id, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 5}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: randcol, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 107, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 107, IndexID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 107, Name: shipments_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[IndexComment:{DescID: 107, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[IndexComment:{DescID: 107, IndexID: 1, Comment: pkey is good}, ABSENT], PUBLIC] -> ABSENT [[ForeignKeyConstraint:{DescID: 107, ConstraintID: 2, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 107, Name: fk_customers, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ConstraintComment:{DescID: 107, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT + [[ConstraintComment:{DescID: 107, ConstraintID: 2, Comment: customer is not god}, ABSENT], PUBLIC] -> ABSENT [[ForeignKeyConstraint:{DescID: 107, ConstraintID: 3, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 107, Name: fk_orders, ConstraintID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ConstraintComment:{DescID: 107, ConstraintID: 3}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: sq1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Sequence:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: customer_id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 109, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: @@ -344,7 +342,7 @@ deps DROP TABLE defaultdb.shipments CASCADE; ---- - from: [Column:{DescID: 107, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] + to: [ColumnComment:{DescID: 107, ColumnID: 1, Comment: tracking_number is a must}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 1}, WRITE_ONLY] @@ -355,10 +353,6 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: carrier, ColumnID: 2}, ABSENT] kind: Precedence @@ -367,10 +361,6 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: status, ColumnID: 3}, ABSENT] kind: Precedence @@ -379,10 +369,6 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 4}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 4}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 4}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: customer_id, ColumnID: 4}, ABSENT] kind: Precedence @@ -391,10 +377,6 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 5}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 5}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 5}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: randcol, ColumnID: 5}, ABSENT] kind: Precedence @@ -403,10 +385,6 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 5}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: customer_id, ColumnID: 1}, ABSENT] kind: Precedence @@ -415,10 +393,6 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: carrier, ColumnID: 2}, ABSENT] kind: Precedence @@ -427,62 +401,14 @@ DROP TABLE defaultdb.shipments CASCADE; to: [ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] +- from: [ColumnComment:{DescID: 107, ColumnID: 1, Comment: tracking_number is a must}, ABSENT] to: [Column:{DescID: 107, ColumnID: 1}, ABSENT] kind: Precedence rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - to: [Table:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT] - to: [Table:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 3}, ABSENT] +- from: [ColumnComment:{DescID: 107, ColumnID: 1, Comment: tracking_number is a must}, ABSENT] to: [Table:{DescID: 107}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 4}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 4}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 4}, ABSENT] - to: [Table:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 5}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 5}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 5}, ABSENT] - to: [Table:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 1}, ABSENT] - to: [View:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 109, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 109, ColumnID: 2}, ABSENT] - to: [View:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [ColumnDefaultExpression:{DescID: 107, ColumnID: 1}, ABSENT] to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -587,11 +513,7 @@ DROP TABLE defaultdb.shipments CASCADE; to: [Column:{DescID: 109, ColumnID: 2}, ABSENT] kind: Precedence rule: dependents removed before column -- from: [ConstraintComment:{DescID: 107, ConstraintID: 2}, ABSENT] - to: [Table:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ConstraintComment:{DescID: 107, ConstraintID: 3}, ABSENT] +- from: [ConstraintComment:{DescID: 107, ConstraintID: 2, Comment: customer is not god}, ABSENT] to: [Table:{DescID: 107}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop @@ -611,11 +533,11 @@ DROP TABLE defaultdb.shipments CASCADE; to: [Table:{DescID: 107}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [IndexComment:{DescID: 107, IndexID: 1}, ABSENT] +- from: [IndexComment:{DescID: 107, IndexID: 1, Comment: pkey is good}, ABSENT] to: [PrimaryIndex:{DescID: 107, IndexID: 1}, ABSENT] kind: Precedence rule: dependents removed before index -- from: [IndexComment:{DescID: 107, IndexID: 1}, ABSENT] +- from: [IndexComment:{DescID: 107, IndexID: 1, Comment: pkey is good}, ABSENT] to: [Table:{DescID: 107}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop @@ -664,7 +586,7 @@ DROP TABLE defaultdb.shipments CASCADE; kind: Precedence rule: dependent element removal before descriptor drop - from: [PrimaryIndex:{DescID: 107, IndexID: 1}, VALIDATED] - to: [IndexComment:{DescID: 107, IndexID: 1}, ABSENT] + to: [IndexComment:{DescID: 107, IndexID: 1, Comment: pkey is good}, ABSENT] kind: Precedence rule: dependents removed after index no longer public - from: [PrimaryIndex:{DescID: 107, IndexID: 1}, VALIDATED] @@ -707,18 +629,10 @@ DROP TABLE defaultdb.shipments CASCADE; to: [PrimaryIndex:{DescID: 107, IndexID: 1}, ABSENT] kind: SameStagePrecedence rule: dependent element removal right after descriptor removal -- from: [TableComment:{DescID: 107}, ABSENT] +- from: [TableComment:{DescID: 107, Comment: shipment is important}, ABSENT] to: [Table:{DescID: 107}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 108}, ABSENT] - to: [Sequence:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 109}, ABSENT] - to: [View:{DescID: 109}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [UserPrivileges:{DescID: 107, Name: admin}, ABSENT] to: [Table:{DescID: 107}, DROPPED] kind: Precedence @@ -786,32 +700,25 @@ PreCommitPhase stage 1 of 1 with 18 MutationType ops [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Table:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 112}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 112, ColumnFamilyID: 0, Name: primary}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 112, Name: x, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 112, Name: y, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 112, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 112, Name: rowid, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 112, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 112, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 112, IndexID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 112, Name: greeter_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[IndexComment:{DescID: 112, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndexPartial:{DescID: 112, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 112, IndexID: 2}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 112, Name: i, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[IndexComment:{DescID: 112, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[CheckConstraint:{DescID: 112, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 112, Name: check, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ConstraintComment:{DescID: 112, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_view b/pkg/sql/schemachanger/scplan/testdata/drop_view index f031e405ab55..03785b60ec60 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_view +++ b/pkg/sql/schemachanger/scplan/testdata/drop_view @@ -23,11 +23,9 @@ PreCommitPhase stage 1 of 1 with 8 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: @@ -101,10 +99,6 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops deps DROP VIEW defaultdb.v1 ---- -- from: [Column:{DescID: 105, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 105, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -113,14 +107,6 @@ DROP VIEW defaultdb.v1 to: [ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 105, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT] - to: [View:{DescID: 105}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT] to: [Column:{DescID: 105, ColumnID: 1}, ABSENT] kind: Precedence @@ -145,10 +131,6 @@ DROP VIEW defaultdb.v1 to: [View:{DescID: 105}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 105}, ABSENT] - to: [View:{DescID: 105}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [UserPrivileges:{DescID: 105, Name: admin}, ABSENT] to: [View:{DescID: 105}, DROPPED] kind: Precedence @@ -211,75 +193,60 @@ PreCommitPhase stage 1 of 1 with 40 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 106, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 106, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: v3, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: v4, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v5, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[TableComment:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 111, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 111, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 111, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[ColumnComment:{DescID: 111, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT ops: *scop.DrainDescriptorName Namespace: @@ -592,10 +559,6 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 29 MutationType ops deps DROP VIEW defaultdb.v1 CASCADE ---- -- from: [Column:{DescID: 105, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 105, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -604,10 +567,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 106, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 106, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 106, Name: n1, ColumnID: 1}, ABSENT] kind: Precedence @@ -616,10 +575,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 106, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 106, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 106, Name: n2, ColumnID: 2}, ABSENT] kind: Precedence @@ -628,10 +583,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT] kind: Precedence @@ -640,10 +591,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: n1, ColumnID: 2}, ABSENT] kind: Precedence @@ -652,10 +599,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 108, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 108, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 108, Name: n2, ColumnID: 1}, ABSENT] kind: Precedence @@ -664,10 +607,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 108, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 108, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 108, Name: n1, ColumnID: 2}, ABSENT] kind: Precedence @@ -676,10 +615,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 111, ColumnID: 1}, WRITE_ONLY] - to: [ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 111, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 111, Name: k, ColumnID: 1}, ABSENT] kind: Precedence @@ -688,10 +623,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 111, ColumnID: 2}, WRITE_ONLY] - to: [ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 111, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 111, Name: n2, ColumnID: 2}, ABSENT] kind: Precedence @@ -700,10 +631,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [Column:{DescID: 111, ColumnID: 3}, WRITE_ONLY] - to: [ColumnComment:{DescID: 111, ColumnID: 3}, ABSENT] - kind: Precedence - rule: column dependents removed after column no longer public - from: [Column:{DescID: 111, ColumnID: 3}, WRITE_ONLY] to: [ColumnName:{DescID: 111, Name: n1, ColumnID: 3}, ABSENT] kind: Precedence @@ -712,86 +639,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 3}, ABSENT] kind: Precedence rule: column dependents removed after column no longer public -- from: [ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 105, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 105, ColumnID: 1}, ABSENT] - to: [View:{DescID: 105}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 106, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 106, ColumnID: 1}, ABSENT] - to: [View:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 106, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 106, ColumnID: 2}, ABSENT] - to: [View:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 1}, ABSENT] - to: [View:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 107, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 107, ColumnID: 2}, ABSENT] - to: [View:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 108, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 108, ColumnID: 1}, ABSENT] - to: [View:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 108, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 108, ColumnID: 2}, ABSENT] - to: [View:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT] - to: [Column:{DescID: 111, ColumnID: 1}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 111, ColumnID: 1}, ABSENT] - to: [View:{DescID: 111}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT] - to: [Column:{DescID: 111, ColumnID: 2}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 111, ColumnID: 2}, ABSENT] - to: [View:{DescID: 111}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [ColumnComment:{DescID: 111, ColumnID: 3}, ABSENT] - to: [Column:{DescID: 111, ColumnID: 3}, ABSENT] - kind: Precedence - rule: dependents removed before column -- from: [ColumnComment:{DescID: 111, ColumnID: 3}, ABSENT] - to: [View:{DescID: 111}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT] to: [Column:{DescID: 105, ColumnID: 1}, ABSENT] kind: Precedence @@ -972,26 +819,6 @@ DROP VIEW defaultdb.v1 CASCADE to: [View:{DescID: 111}, DROPPED] kind: Precedence rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 105}, ABSENT] - to: [View:{DescID: 105}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 106}, ABSENT] - to: [View:{DescID: 106}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 107}, ABSENT] - to: [View:{DescID: 107}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 108}, ABSENT] - to: [View:{DescID: 108}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop -- from: [TableComment:{DescID: 111}, ABSENT] - to: [View:{DescID: 111}, DROPPED] - kind: Precedence - rule: dependent element removal before descriptor drop - from: [UserPrivileges:{DescID: 105, Name: admin}, ABSENT] to: [View:{DescID: 105}, DROPPED] kind: Precedence diff --git a/pkg/sql/schemachanger/testdata/comment_on b/pkg/sql/schemachanger/testdata/comment_on new file mode 100644 index 000000000000..31c4e056e419 --- /dev/null +++ b/pkg/sql/schemachanger/testdata/comment_on @@ -0,0 +1,180 @@ +setup +CREATE DATABASE db; +CREATE SCHEMA db.sc; +CREATE TABLE db.sc.t ( + id INT PRIMARY KEY, + amount INT, + CONSTRAINT t_amount_gt_10 CHECK(amount > 10) +); +---- +... ++database {0 0 db} -> 104 ++schema {104 0 public} -> 105 ++schema {104 0 sc} -> 106 ++object {104 106 t} -> 107 + +test +COMMENT ON DATABASE db IS 'db is good'; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +## StatementPhase stage 1 of 1 with 1 MutationType ops +upsert db is good comment for descriptor #104 of type DatabaseCommentType +# end StatementPhase +# begin PreCommitPhase +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON SCHEMA db.sc IS 'sc is good'; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +## StatementPhase stage 1 of 1 with 1 MutationType ops +upsert sc is good comment for descriptor #106 of type SchemaCommentType +# end StatementPhase +# begin PreCommitPhase +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON TABLE db.sc.t IS 't is good'; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +## StatementPhase stage 1 of 1 with 1 MutationType ops +upsert t is good comment for descriptor #107 of type TableCommentType +# end StatementPhase +# begin PreCommitPhase +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON COLUMN db.sc.t.id IS 'id is good'; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +## StatementPhase stage 1 of 1 with 1 MutationType ops +upsert id is good comment for descriptor #107 of type ColumnCommentType +# end StatementPhase +# begin PreCommitPhase +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON INDEX db.sc.t@t_pkey IS 'pkey is good'; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +## StatementPhase stage 1 of 1 with 1 MutationType ops +upsert pkey is good comment for descriptor #107 of type IndexCommentType +# end StatementPhase +# begin PreCommitPhase +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON CONSTRAINT t_amount_gt_10 ON db.sc.t IS 'amount constraint is good'; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +## StatementPhase stage 1 of 1 with 1 MutationType ops +upsert amount constraint is good comment for descriptor #107 of type ConstraintCommentType +# end StatementPhase +# begin PreCommitPhase +# end PreCommitPhase +commit transaction #1 + +setup +COMMENT ON DATABASE db IS 'db is good'; +COMMENT ON SCHEMA db.sc IS 'sc is good'; +COMMENT ON TABLE db.sc.t IS 't is good'; +COMMENT ON COLUMN db.sc.t.id IS 'id is good'; +COMMENT ON INDEX db.sc.t@t_pkey IS 'pkey is good'; +COMMENT ON CONSTRAINT t_amount_gt_10 ON db.sc.t IS 'amount constraint is good'; +---- +... + +test +COMMENT ON DATABASE db IS NULL; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +# end StatementPhase +# begin PreCommitPhase +## PreCommitPhase stage 1 of 1 with 1 MutationType ops +delete comment for descriptor #104 of type DatabaseCommentType +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON SCHEMA db.sc IS NULL; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +# end StatementPhase +# begin PreCommitPhase +## PreCommitPhase stage 1 of 1 with 1 MutationType ops +delete comment for descriptor #106 of type SchemaCommentType +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON TABLE db.sc.t IS NULL; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +# end StatementPhase +# begin PreCommitPhase +## PreCommitPhase stage 1 of 1 with 1 MutationType ops +delete comment for descriptor #107 of type TableCommentType +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON COLUMN db.sc.t.id IS NULL; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +# end StatementPhase +# begin PreCommitPhase +## PreCommitPhase stage 1 of 1 with 1 MutationType ops +delete comment for descriptor #107 of type ColumnCommentType +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON INDEX db.sc.t@t_pkey IS NULL; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +# end StatementPhase +# begin PreCommitPhase +## PreCommitPhase stage 1 of 1 with 1 MutationType ops +delete comment for descriptor #107 of type IndexCommentType +# end PreCommitPhase +commit transaction #1 + +test +COMMENT ON CONSTRAINT t_amount_gt_10 ON db.sc.t IS NULL; +---- +checking for feature: COMMENT ON +begin transaction #1 +# begin StatementPhase +# end StatementPhase +# begin PreCommitPhase +## PreCommitPhase stage 1 of 1 with 1 MutationType ops +delete comment for constraint on #107, constraint id: 2 +# end PreCommitPhase +commit transaction #1 diff --git a/pkg/sql/schemachanger/testdata/drop b/pkg/sql/schemachanger/testdata/drop index 92a62b5592d1..b90ed1829a69 100644 --- a/pkg/sql/schemachanger/testdata/drop +++ b/pkg/sql/schemachanger/testdata/drop @@ -1,6 +1,8 @@ setup CREATE DATABASE db; CREATE SCHEMA db.sc; +COMMENT ON DATABASE db IS 'db is good'; +COMMENT ON SCHEMA db.sc IS 'sc is good'; ---- ... +database {0 0 db} -> 104 @@ -115,7 +117,7 @@ upsert descriptor #106 + targetStatus: ABSENT + - elementProto: + schemaComment: - + comment: __placeholder_comment__ + + comment: sc is good + schemaId: 106 + metadata: + sourceElementId: 1 @@ -162,6 +164,10 @@ setup CREATE SCHEMA db.sc; CREATE TABLE db.sc.t (k INT, v STRING); CREATE TYPE db.sc.e AS ENUM('a', 'b', 'c'); +COMMENT ON SCHEMA db.sc IS 'sc is good'; +COMMENT ON TABLE db.sc.t IS 't is good'; +COMMENT ON COLUMN db.sc.t.k IS 'col k is good'; +COMMENT ON INDEX db.sc.t@t_pkey IS 'pkey is good'; ---- ... +schema {104 0 sc} -> 107 @@ -204,12 +210,10 @@ upsert descriptor #108 + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT + - ABSENT - + - ABSENT + - VALIDATED + - ABSENT + - ABSENT @@ -242,8 +246,6 @@ upsert descriptor #108 + - 19 + - 20 + - 21 - + - 22 - + - 23 + targets: + - elementProto: + namespace: @@ -298,7 +300,7 @@ upsert descriptor #108 + targetStatus: ABSENT + - elementProto: + tableComment: - + comment: __placeholder_comment__ + + comment: t is good + tableId: 108 + metadata: + sourceElementId: 1 @@ -347,7 +349,7 @@ upsert descriptor #108 + - elementProto: + columnComment: + columnId: 1 - + comment: __placeholder_comment__ + + comment: col k is good + tableId: 108 + metadata: + sourceElementId: 1 @@ -385,15 +387,6 @@ upsert descriptor #108 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 108 - + metadata: - + sourceElementId: 1 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 3 + isHidden: true @@ -436,15 +429,6 @@ upsert descriptor #108 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 3 - + comment: __placeholder_comment__ - + tableId: 108 - + metadata: - + sourceElementId: 1 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + primaryIndex: + embeddedIndex: + indexId: 1 @@ -472,7 +456,7 @@ upsert descriptor #108 + targetStatus: ABSENT + - elementProto: + indexComment: - + comment: __placeholder_comment__ + + comment: pkey is good + indexId: 1 + tableId: 108 + metadata: @@ -522,12 +506,10 @@ upsert descriptor #108 - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - ABSENT - - - ABSENT - - VALIDATED - - ABSENT - - ABSENT @@ -560,8 +542,6 @@ upsert descriptor #108 - - 19 - - 20 - - 21 - - - 22 - - - 23 - targets: - - elementProto: - namespace: @@ -616,7 +596,7 @@ upsert descriptor #108 - targetStatus: ABSENT - - elementProto: - tableComment: - - comment: __placeholder_comment__ + - comment: t is good - tableId: 108 - metadata: - sourceElementId: 1 @@ -665,7 +645,7 @@ upsert descriptor #108 - - elementProto: - columnComment: - columnId: 1 - - comment: __placeholder_comment__ + - comment: col k is good - tableId: 108 - metadata: - sourceElementId: 1 @@ -703,15 +683,6 @@ upsert descriptor #108 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 2 - - comment: __placeholder_comment__ - - tableId: 108 - - metadata: - - sourceElementId: 1 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - column: - columnId: 3 - isHidden: true @@ -754,15 +725,6 @@ upsert descriptor #108 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 3 - - comment: __placeholder_comment__ - - tableId: 108 - - metadata: - - sourceElementId: 1 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - primaryIndex: - embeddedIndex: - indexId: 1 @@ -790,7 +752,7 @@ upsert descriptor #108 - targetStatus: ABSENT - - elementProto: - indexComment: - - comment: __placeholder_comment__ + - comment: pkey is good - indexId: 1 - tableId: 108 - metadata: @@ -921,7 +883,7 @@ upsert descriptor #107 + targetStatus: ABSENT + - elementProto: + schemaComment: - + comment: __placeholder_comment__ + + comment: sc is good + schemaId: 107 + metadata: + sourceElementId: 1 @@ -1185,7 +1147,7 @@ begin transaction #1 ## StatementPhase stage 1 of 1 with 2 MutationType ops # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 11 MutationType ops +## PreCommitPhase stage 1 of 1 with 10 MutationType ops delete database namespace entry {0 0 db} -> 104 delete schema namespace entry {104 0 public} -> 105 upsert descriptor #104 @@ -1278,7 +1240,7 @@ upsert descriptor #104 + targetStatus: ABSENT + - elementProto: + databaseComment: - + comment: __placeholder_comment__ + + comment: db is good + databaseId: 104 + metadata: + sourceElementId: 1 @@ -1305,7 +1267,6 @@ upsert descriptor #105 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -1320,7 +1281,6 @@ upsert descriptor #105 + - 12 + - 13 + - 14 - + - 15 + targets: + - elementProto: + namespace: @@ -1381,14 +1341,6 @@ upsert descriptor #105 + metadata: + sourceElementId: 2 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + schemaComment: - + comment: __placeholder_comment__ - + schemaId: 105 - + metadata: - + sourceElementId: 2 - + subWorkId: 1 + targetStatus: ABSENT id: 105 modificationTime: {} @@ -1399,7 +1351,6 @@ upsert descriptor #105 + state: DROP + version: "2" delete comment for descriptor #104 of type DatabaseCommentType -delete comment for descriptor #105 of type SchemaCommentType delete role settings for database on #104 create job #1 (non-cancelable: true): "DROP DATABASE db CASCADE" descriptor IDs: [104 105] @@ -1432,6 +1383,10 @@ CREATE VIEW db1.sc1.v3 AS (SELECT name, n1 FROM db1.sc1.v1, db1.sc1.v2); CREATE VIEW db1.sc1.v4 AS (SELECT n2, n1 FROM db1.sc1.v2); CREATE TYPE db1.sc1.typ AS ENUM('a'); CREATE VIEW db1.sc1.v5 AS (SELECT 'a'::db1.sc1.typ::string AS k, n2, n1 from db1.sc1.v4); +COMMENT ON DATABASE db1 IS 'db1 is good'; +COMMENT ON SCHEMA db1.sc1 IS 'sc1 is good'; +COMMENT ON TABLE db1.sc1.t1 IS 'sc1.t1 is good'; +COMMENT ON TABLE db1.public.t1 IS 'public.t1 is good'; ---- ... +database {0 0 db1} -> 111 @@ -1460,7 +1415,7 @@ begin transaction #1 ## StatementPhase stage 1 of 1 with 15 MutationType ops # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 92 MutationType ops +## PreCommitPhase stage 1 of 1 with 91 MutationType ops delete database namespace entry {0 0 db1} -> 111 delete schema namespace entry {111 0 public} -> 112 delete schema namespace entry {111 0 sc1} -> 113 @@ -1566,7 +1521,7 @@ upsert descriptor #111 + targetStatus: ABSENT + - elementProto: + databaseComment: - + comment: __placeholder_comment__ + + comment: db1 is good + databaseId: 111 + metadata: + sourceElementId: 1 @@ -1593,7 +1548,6 @@ upsert descriptor #112 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -1608,7 +1562,6 @@ upsert descriptor #112 + - 12 + - 13 + - 14 - + - 15 + targets: + - elementProto: + namespace: @@ -1669,14 +1622,6 @@ upsert descriptor #112 + metadata: + sourceElementId: 2 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + schemaComment: - + comment: __placeholder_comment__ - + schemaId: 112 - + metadata: - + sourceElementId: 2 - + subWorkId: 1 + targetStatus: ABSENT id: 112 modificationTime: {} @@ -1706,13 +1651,13 @@ upsert descriptor #113 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 - + - 22 + targets: + - elementProto: + namespace: @@ -1766,7 +1711,7 @@ upsert descriptor #113 + targetStatus: ABSENT + - elementProto: + schemaComment: - + comment: __placeholder_comment__ + + comment: sc1 is good + schemaId: 113 + metadata: + sourceElementId: 2 @@ -1794,7 +1739,6 @@ upsert descriptor #114 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -1802,13 +1746,12 @@ upsert descriptor #114 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 22 + - 23 + - 24 + - 25 + - 26 + - 27 - + - 28 - + - 29 + targets: + - elementProto: + namespace: @@ -1860,14 +1803,6 @@ upsert descriptor #114 + metadata: + sourceElementId: 3 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 114 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 + targetStatus: ABSENT dependedOnBy: - byId: true @@ -1892,7 +1827,6 @@ upsert descriptor #115 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -1900,13 +1834,12 @@ upsert descriptor #115 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 76 - + - 77 - + - 78 - + - 79 - + - 80 - + - 81 - + - 82 + + - 66 + + - 67 + + - 68 + + - 69 + + - 70 + + - 71 + targets: + - elementProto: + namespace: @@ -1958,14 +1891,6 @@ upsert descriptor #115 + metadata: + sourceElementId: 7 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 115 - + metadata: - + sourceElementId: 7 - + subWorkId: 1 + targetStatus: ABSENT dependedOnBy: - byId: true @@ -1995,19 +1920,15 @@ upsert descriptor #116 + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT + - ABSENT - + - ABSENT + - VALIDATED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -2015,6 +1936,17 @@ upsert descriptor #116 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 72 + + - 73 + + - 74 + + - 75 + + - 76 + + - 77 + + - 78 + + - 79 + + - 80 + + - 81 + + - 82 + - 83 + - 84 + - 85 @@ -2024,21 +1956,6 @@ upsert descriptor #116 + - 89 + - 90 + - 91 - + - 92 - + - 93 - + - 94 - + - 95 - + - 96 - + - 97 - + - 98 - + - 99 - + - 100 - + - 101 - + - 102 - + - 103 - + - 104 - + - 105 - + - 106 + targets: + - elementProto: + namespace: @@ -2093,7 +2010,7 @@ upsert descriptor #116 + targetStatus: ABSENT + - elementProto: + tableComment: - + comment: __placeholder_comment__ + + comment: sc1.t1 is good + tableId: 116 + metadata: + sourceElementId: 7 @@ -2139,15 +2056,6 @@ upsert descriptor #116 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 116 - + metadata: - + sourceElementId: 7 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + tableId: 116 @@ -2181,15 +2089,6 @@ upsert descriptor #116 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 116 - + metadata: - + sourceElementId: 7 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 3 + tableId: 116 @@ -2234,15 +2133,6 @@ upsert descriptor #116 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 3 - + comment: __placeholder_comment__ - + tableId: 116 - + metadata: - + sourceElementId: 7 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + primaryIndex: + embeddedIndex: + indexId: 1 @@ -2267,15 +2157,6 @@ upsert descriptor #116 + metadata: + sourceElementId: 7 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + indexComment: - + comment: __placeholder_comment__ - + indexId: 1 - + tableId: 116 - + metadata: - + sourceElementId: 7 - + subWorkId: 1 + targetStatus: ABSENT dependedOnBy: - columnIds: @@ -2310,19 +2191,15 @@ upsert descriptor #117 + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT + - ABSENT - + - ABSENT + - VALIDATED + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -2330,6 +2207,8 @@ upsert descriptor #117 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 28 + + - 29 + - 30 + - 31 + - 32 @@ -2348,12 +2227,6 @@ upsert descriptor #117 + - 45 + - 46 + - 47 - + - 48 - + - 49 - + - 50 - + - 51 - + - 52 - + - 53 + targets: + - elementProto: + namespace: @@ -2408,7 +2281,7 @@ upsert descriptor #117 + targetStatus: ABSENT + - elementProto: + tableComment: - + comment: __placeholder_comment__ + + comment: public.t1 is good + tableId: 117 + metadata: + sourceElementId: 3 @@ -2454,15 +2327,6 @@ upsert descriptor #117 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 117 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + tableId: 117 @@ -2496,15 +2360,6 @@ upsert descriptor #117 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 117 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 3 + tableId: 117 @@ -2549,15 +2404,6 @@ upsert descriptor #117 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 3 - + comment: __placeholder_comment__ - + tableId: 117 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + primaryIndex: + embeddedIndex: + indexId: 1 @@ -2583,15 +2429,6 @@ upsert descriptor #117 + sourceElementId: 3 + subWorkId: 1 + targetStatus: ABSENT - + - elementProto: - + indexComment: - + comment: __placeholder_comment__ - + indexId: 1 - + tableId: 117 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT + dropTime: " families: - columnIds: @@ -2617,20 +2454,16 @@ upsert descriptor #118 + - DROPPED + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT + - ABSENT + - ABSENT - + - ABSENT + - VALIDATED + - ABSENT - + - ABSENT + - PUBLIC + jobId: "1" + relevantStatements: @@ -2639,6 +2472,12 @@ upsert descriptor #118 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: + + - 48 + + - 49 + + - 50 + + - 51 + + - 52 + + - 53 + - 54 + - 55 + - 56 @@ -2651,16 +2490,6 @@ upsert descriptor #118 + - 63 + - 64 + - 65 - + - 66 - + - 67 - + - 68 - + - 69 - + - 70 - + - 71 - + - 72 - + - 73 - + - 74 - + - 75 + targets: + - elementProto: + namespace: @@ -2714,14 +2543,6 @@ upsert descriptor #118 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 118 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + columnFamily: + name: primary + tableId: 118 @@ -2761,15 +2582,6 @@ upsert descriptor #118 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 118 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + isHidden: true @@ -2821,15 +2633,6 @@ upsert descriptor #118 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 118 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + primaryIndex: + embeddedIndex: + indexId: 1 @@ -2855,15 +2658,6 @@ upsert descriptor #118 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + indexComment: - + comment: __placeholder_comment__ - + indexId: 1 - + tableId: 118 - + metadata: - + sourceElementId: 3 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + rowLevelTtl: + rowLevelTtl: + durationExpr: '''00:10:00'':::INTERVAL' @@ -2897,11 +2691,9 @@ upsert descriptor #119 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -2909,17 +2701,15 @@ upsert descriptor #119 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 107 - + - 108 - + - 109 - + - 110 - + - 111 - + - 112 - + - 113 - + - 114 - + - 115 - + - 116 - + - 117 + + - 92 + + - 93 + + - 94 + + - 95 + + - 96 + + - 97 + + - 98 + + - 99 + + - 100 + targets: + - elementProto: + namespace: @@ -2975,14 +2765,6 @@ upsert descriptor #119 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 119 - + metadata: - + sourceElementId: 9 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 1 + tableId: 119 @@ -3014,15 +2796,6 @@ upsert descriptor #119 + metadata: + sourceElementId: 9 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 119 - + metadata: - + sourceElementId: 9 - + subWorkId: 1 + targetStatus: ABSENT dependedOnBy: - columnIds: @@ -3048,15 +2821,12 @@ upsert descriptor #120 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -3064,21 +2834,18 @@ upsert descriptor #120 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 118 - + - 119 - + - 120 - + - 121 - + - 122 - + - 123 - + - 124 - + - 125 - + - 126 - + - 127 - + - 128 - + - 129 - + - 130 - + - 131 - + - 132 + + - 101 + + - 102 + + - 103 + + - 104 + + - 105 + + - 106 + + - 107 + + - 108 + + - 109 + + - 110 + + - 111 + + - 112 + targets: + - elementProto: + namespace: @@ -3134,14 +2901,6 @@ upsert descriptor #120 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 120 - + metadata: - + sourceElementId: 10 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 1 + tableId: 120 @@ -3175,15 +2934,6 @@ upsert descriptor #120 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 120 - + metadata: - + sourceElementId: 10 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + tableId: 120 @@ -3215,15 +2965,6 @@ upsert descriptor #120 + metadata: + sourceElementId: 10 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 120 - + metadata: - + sourceElementId: 10 - + subWorkId: 1 + targetStatus: ABSENT dependedOnBy: - columnIds: @@ -3249,15 +2990,12 @@ upsert descriptor #121 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -3265,21 +3003,18 @@ upsert descriptor #121 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 133 - + - 134 - + - 135 - + - 136 - + - 137 - + - 138 - + - 139 - + - 140 - + - 141 - + - 142 - + - 143 - + - 144 - + - 145 - + - 146 - + - 147 + + - 113 + + - 114 + + - 115 + + - 116 + + - 117 + + - 118 + + - 119 + + - 120 + + - 121 + + - 122 + + - 123 + + - 124 + targets: + - elementProto: + namespace: @@ -3336,14 +3071,6 @@ upsert descriptor #121 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 121 - + metadata: - + sourceElementId: 11 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 1 + tableId: 121 @@ -3377,15 +3104,6 @@ upsert descriptor #121 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 121 - + metadata: - + sourceElementId: 11 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + tableId: 121 @@ -3417,15 +3135,6 @@ upsert descriptor #121 + metadata: + sourceElementId: 11 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 121 - + metadata: - + sourceElementId: 11 - + subWorkId: 1 + targetStatus: ABSENT dependsOn: - 119 @@ -3451,15 +3160,12 @@ upsert descriptor #122 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -3467,21 +3173,18 @@ upsert descriptor #122 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 148 - + - 149 - + - 150 - + - 151 - + - 152 - + - 153 - + - 154 - + - 155 - + - 156 - + - 157 - + - 158 - + - 159 - + - 160 - + - 161 - + - 162 + + - 125 + + - 126 + + - 127 + + - 128 + + - 129 + + - 130 + + - 131 + + - 132 + + - 133 + + - 134 + + - 135 + + - 136 + targets: + - elementProto: + namespace: @@ -3537,14 +3240,6 @@ upsert descriptor #122 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 122 - + metadata: - + sourceElementId: 11 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 1 + tableId: 122 @@ -3578,15 +3273,6 @@ upsert descriptor #122 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 122 - + metadata: - + sourceElementId: 11 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + tableId: 122 @@ -3618,15 +3304,6 @@ upsert descriptor #122 + metadata: + sourceElementId: 11 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 122 - + metadata: - + sourceElementId: 11 - + subWorkId: 1 + targetStatus: ABSENT dependedOnBy: - columnIds: @@ -3659,13 +3336,13 @@ upsert descriptor #123 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 163 - + - 164 - + - 165 - + - 166 - + - 167 - + - 168 - + - 169 + + - 137 + + - 138 + + - 139 + + - 140 + + - 141 + + - 142 + + - 143 + targets: + - elementProto: + namespace: @@ -3758,13 +3435,13 @@ upsert descriptor #124 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 170 - + - 171 - + - 172 - + - 173 - + - 174 - + - 175 - + - 176 + + - 144 + + - 145 + + - 146 + + - 147 + + - 148 + + - 149 + + - 150 + targets: + - elementProto: + namespace: @@ -3861,19 +3538,15 @@ upsert descriptor #125 + - ABSENT + - DROPPED + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + - WRITE_ONLY + - ABSENT + - ABSENT - + - ABSENT + jobId: "1" + relevantStatements: + - statement: @@ -3881,25 +3554,21 @@ upsert descriptor #125 + statement: DROP DATABASE db1 CASCADE + statementTag: DROP DATABASE + targetRanks: - + - 177 - + - 178 - + - 179 - + - 180 - + - 181 - + - 182 - + - 183 - + - 184 - + - 185 - + - 186 - + - 187 - + - 188 - + - 189 - + - 190 - + - 191 - + - 192 - + - 193 - + - 194 - + - 195 + + - 151 + + - 152 + + - 153 + + - 154 + + - 155 + + - 156 + + - 157 + + - 158 + + - 159 + + - 160 + + - 161 + + - 162 + + - 163 + + - 164 + + - 165 + targets: + - elementProto: + namespace: @@ -3958,14 +3627,6 @@ upsert descriptor #125 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + tableComment: - + comment: __placeholder_comment__ - + tableId: 125 - + metadata: - + sourceElementId: 13 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 1 + tableId: 125 @@ -3997,15 +3658,6 @@ upsert descriptor #125 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 1 - + comment: __placeholder_comment__ - + tableId: 125 - + metadata: - + sourceElementId: 13 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 2 + tableId: 125 @@ -4039,15 +3691,6 @@ upsert descriptor #125 + subWorkId: 1 + targetStatus: ABSENT + - elementProto: - + columnComment: - + columnId: 2 - + comment: __placeholder_comment__ - + tableId: 125 - + metadata: - + sourceElementId: 13 - + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: + column: + columnId: 3 + tableId: 125 @@ -4079,15 +3722,6 @@ upsert descriptor #125 + metadata: + sourceElementId: 13 + subWorkId: 1 - + targetStatus: ABSENT - + - elementProto: - + columnComment: - + columnId: 3 - + comment: __placeholder_comment__ - + tableId: 125 - + metadata: - + sourceElementId: 13 - + subWorkId: 1 + targetStatus: ABSENT dependsOn: - 122 @@ -4100,7 +3734,6 @@ upsert descriptor #125 + version: "2" viewQuery: (SELECT 'a':::sc1.typ::STRING AS k, n2, n1 FROM db1.sc1.v4) delete comment for descriptor #111 of type DatabaseCommentType -delete comment for descriptor #112 of type SchemaCommentType delete comment for descriptor #113 of type SchemaCommentType delete all comments for table descriptors [114 115 116 117 118 119 120 121 122 125] delete role settings for database on #111 @@ -4127,7 +3760,6 @@ upsert descriptor #114 - - ABSENT - - DROPPED - - ABSENT - - - ABSENT - jobId: "1" - relevantStatements: - - statement: @@ -4135,13 +3767,12 @@ upsert descriptor #114 - statement: DROP DATABASE db1 CASCADE - statementTag: DROP DATABASE - targetRanks: + - - 22 - - 23 - - 24 - - 25 - - 26 - - 27 - - - 28 - - - 29 - targets: - - elementProto: - namespace: @@ -4193,14 +3824,6 @@ upsert descriptor #114 - metadata: - sourceElementId: 3 - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - - tableComment: - - comment: __placeholder_comment__ - - tableId: 114 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - targetStatus: ABSENT dependedOnBy: - byId: true @@ -4223,7 +3846,6 @@ upsert descriptor #115 - - ABSENT - - DROPPED - - ABSENT - - - ABSENT - jobId: "1" - relevantStatements: - - statement: @@ -4231,13 +3853,12 @@ upsert descriptor #115 - statement: DROP DATABASE db1 CASCADE - statementTag: DROP DATABASE - targetRanks: - - - 76 - - - 77 - - - 78 - - - 79 - - - 80 - - - 81 - - - 82 + - - 66 + - - 67 + - - 68 + - - 69 + - - 70 + - - 71 - targets: - - elementProto: - namespace: @@ -4289,14 +3910,6 @@ upsert descriptor #115 - metadata: - sourceElementId: 7 - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - - tableComment: - - comment: __placeholder_comment__ - - tableId: 115 - - metadata: - - sourceElementId: 7 - - subWorkId: 1 - targetStatus: ABSENT dependedOnBy: - byId: true @@ -4324,19 +3937,15 @@ upsert descriptor #116 - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - ABSENT - - - ABSENT - - VALIDATED - - ABSENT - - - ABSENT - jobId: "1" - relevantStatements: - - statement: @@ -4344,6 +3953,17 @@ upsert descriptor #116 - statement: DROP DATABASE db1 CASCADE - statementTag: DROP DATABASE - targetRanks: + - - 72 + - - 73 + - - 74 + - - 75 + - - 76 + - - 77 + - - 78 + - - 79 + - - 80 + - - 81 + - - 82 - - 83 - - 84 - - 85 @@ -4353,21 +3973,6 @@ upsert descriptor #116 - - 89 - - 90 - - 91 - - - 92 - - - 93 - - - 94 - - - 95 - - - 96 - - - 97 - - - 98 - - - 99 - - - 100 - - - 101 - - - 102 - - - 103 - - - 104 - - - 105 - - - 106 - targets: - - elementProto: - namespace: @@ -4422,7 +4027,7 @@ upsert descriptor #116 - targetStatus: ABSENT - - elementProto: - tableComment: - - comment: __placeholder_comment__ + - comment: sc1.t1 is good - tableId: 116 - metadata: - sourceElementId: 7 @@ -4468,15 +4073,6 @@ upsert descriptor #116 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 1 - - comment: __placeholder_comment__ - - tableId: 116 - - metadata: - - sourceElementId: 7 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - column: - columnId: 2 - tableId: 116 @@ -4510,15 +4106,6 @@ upsert descriptor #116 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 2 - - comment: __placeholder_comment__ - - tableId: 116 - - metadata: - - sourceElementId: 7 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - column: - columnId: 3 - tableId: 116 @@ -4563,15 +4150,6 @@ upsert descriptor #116 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 3 - - comment: __placeholder_comment__ - - tableId: 116 - - metadata: - - sourceElementId: 7 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - primaryIndex: - embeddedIndex: - indexId: 1 @@ -4596,15 +4174,6 @@ upsert descriptor #116 - metadata: - sourceElementId: 7 - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - - indexComment: - - comment: __placeholder_comment__ - - indexId: 1 - - tableId: 116 - - metadata: - - sourceElementId: 7 - - subWorkId: 1 - targetStatus: ABSENT dependedOnBy: - columnIds: @@ -4632,19 +4201,15 @@ upsert descriptor #117 - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - ABSENT - - - ABSENT - - VALIDATED - - ABSENT - - - ABSENT - jobId: "1" - relevantStatements: - - statement: @@ -4652,6 +4217,8 @@ upsert descriptor #117 - statement: DROP DATABASE db1 CASCADE - statementTag: DROP DATABASE - targetRanks: + - - 28 + - - 29 - - 30 - - 31 - - 32 @@ -4670,12 +4237,6 @@ upsert descriptor #117 - - 45 - - 46 - - 47 - - - 48 - - - 49 - - - 50 - - - 51 - - - 52 - - - 53 - targets: - - elementProto: - namespace: @@ -4730,7 +4291,7 @@ upsert descriptor #117 - targetStatus: ABSENT - - elementProto: - tableComment: - - comment: __placeholder_comment__ + - comment: public.t1 is good - tableId: 117 - metadata: - sourceElementId: 3 @@ -4776,15 +4337,6 @@ upsert descriptor #117 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 1 - - comment: __placeholder_comment__ - - tableId: 117 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - column: - columnId: 2 - tableId: 117 @@ -4818,15 +4370,6 @@ upsert descriptor #117 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 2 - - comment: __placeholder_comment__ - - tableId: 117 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - column: - columnId: 3 - tableId: 117 @@ -4871,15 +4414,6 @@ upsert descriptor #117 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 3 - - comment: __placeholder_comment__ - - tableId: 117 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - primaryIndex: - embeddedIndex: - indexId: 1 @@ -4904,15 +4438,6 @@ upsert descriptor #117 - metadata: - sourceElementId: 3 - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - - indexComment: - - comment: __placeholder_comment__ - - indexId: 1 - - tableId: 117 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - targetStatus: ABSENT dropTime: " families: @@ -4936,20 +4461,16 @@ upsert descriptor #118 - - DROPPED - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - - ABSENT - - WRITE_ONLY - - ABSENT - - ABSENT - - ABSENT - - ABSENT - - - ABSENT - - VALIDATED - - ABSENT - - - ABSENT - - PUBLIC - jobId: "1" - relevantStatements: @@ -4958,6 +4479,12 @@ upsert descriptor #118 - statement: DROP DATABASE db1 CASCADE - statementTag: DROP DATABASE - targetRanks: + - - 48 + - - 49 + - - 50 + - - 51 + - - 52 + - - 53 - - 54 - - 55 - - 56 @@ -4970,16 +4497,6 @@ upsert descriptor #118 - - 63 - - 64 - - 65 - - - 66 - - - 67 - - - 68 - - - 69 - - - 70 - - - 71 - - - 72 - - - 73 - - - 74 - - - 75 - targets: - - elementProto: - namespace: @@ -5033,14 +4550,6 @@ upsert descriptor #118 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - tableComment: - - comment: __placeholder_comment__ - - tableId: 118 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - columnFamily: - name: primary - tableId: 118 @@ -5080,15 +4589,6 @@ upsert descriptor #118 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 1 - - comment: __placeholder_comment__ - - tableId: 118 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - column: - columnId: 2 - isHidden: true @@ -5140,15 +4640,6 @@ upsert descriptor #118 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - columnComment: - - columnId: 2 - - comment: __placeholder_comment__ - - tableId: 118 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - primaryIndex: - embeddedIndex: - indexId: 1 @@ -5174,15 +4665,6 @@ upsert descriptor #118 - subWorkId: 1 - targetStatus: ABSENT - - elementProto: - - indexComment: - - comment: __placeholder_comment__ - - indexId: 1 - - tableId: 118 - - metadata: - - sourceElementId: 3 - - subWorkId: 1 - - targetStatus: ABSENT - - - elementProto: - rowLevelTtl: - rowLevelTtl: - durationExpr: '''00:10:00'':::INTERVAL'