Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql/schemachanger: implement COMMENT ON in new schema changer #78025

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions pkg/bench/rttanalysis/testdata/benchmark_expectations
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
71 changes: 19 additions & 52 deletions pkg/ccl/schemachangerccl/testdata/decomp/multiregion
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -69,15 +73,18 @@ ElementState:
Status: PUBLIC
- Column:
columnId: 1
pgAttributeNum: 1
tableId: 110
Status: PUBLIC
- Column:
columnId: 2
isHidden: true
pgAttributeNum: 2
tableId: 110
Status: PUBLIC
- PrimaryIndex:
embeddedIndex:
constraintId: 1
indexId: 1
isUnique: true
keyColumnDirections:
Expand All @@ -88,10 +95,6 @@ ElementState:
- 1
tableId: 110
Status: PUBLIC
- TableComment:
comment: __placeholder_comment__
tableId: 110
Status: PUBLIC
- TableLocalityGlobal:
tableId: 110
Status: PUBLIC
Expand Down Expand Up @@ -130,26 +133,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
Expand Down Expand Up @@ -189,15 +177,18 @@ ElementState:
Status: PUBLIC
- Column:
columnId: 1
pgAttributeNum: 1
tableId: 109
Status: PUBLIC
- Column:
columnId: 2
isHidden: true
pgAttributeNum: 2
tableId: 109
Status: PUBLIC
- PrimaryIndex:
embeddedIndex:
constraintId: 1
indexId: 1
isUnique: true
keyColumnDirections:
Expand All @@ -208,10 +199,6 @@ ElementState:
- 1
tableId: 109
Status: PUBLIC
- TableComment:
comment: __placeholder_comment__
tableId: 109
Status: PUBLIC
- TableLocalitySecondaryRegion:
regionEnumTypeId: 105
regionName: us-east2
Expand Down Expand Up @@ -252,26 +239,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
Expand Down Expand Up @@ -311,19 +283,23 @@ ElementState:
Status: PUBLIC
- Column:
columnId: 1
pgAttributeNum: 1
tableId: 108
Status: PUBLIC
- Column:
columnId: 2
pgAttributeNum: 2
tableId: 108
Status: PUBLIC
- Column:
columnId: 3
isHidden: true
pgAttributeNum: 3
tableId: 108
Status: PUBLIC
- PrimaryIndex:
embeddedIndex:
constraintId: 1
indexId: 1
isUnique: true
keyColumnDirections:
Expand All @@ -337,7 +313,7 @@ ElementState:
tableId: 108
Status: PUBLIC
- TableComment:
comment: __placeholder_comment__
comment: regional by row is good
tableId: 108
Status: PUBLIC
- TableLocalityRegionalByRow:
Expand Down Expand Up @@ -400,17 +376,8 @@ 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
pgAttributeNum: 1
tableId: 108
Status: PUBLIC
- IndexName:
Expand Down Expand Up @@ -439,7 +406,7 @@ ElementState:
tableId: 108
Status: PUBLIC
- IndexComment:
comment: __placeholder_comment__
comment: pkey is good
indexId: 1
tableId: 108
Status: PUBLIC
Expand Down
61 changes: 8 additions & 53 deletions pkg/ccl/schemachangerccl/testdata/decomp/partitioning
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ ElementState:
Status: PUBLIC
- Column:
columnId: 1
pgAttributeNum: 1
tableId: 104
Status: PUBLIC
- Column:
columnId: 2
pgAttributeNum: 2
tableId: 104
Status: PUBLIC
- Column:
columnId: 3
pgAttributeNum: 3
tableId: 104
Status: PUBLIC
- PrimaryIndex:
embeddedIndex:
constraintId: 1
indexId: 1
isUnique: true
keyColumnDirections:
Expand All @@ -73,10 +77,6 @@ ElementState:
- 1
tableId: 104
Status: PUBLIC
- TableComment:
comment: __placeholder_comment__
tableId: 104
Status: PUBLIC
- ColumnName:
columnId: 1
name: pk
Expand Down Expand Up @@ -119,21 +119,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
Expand Down Expand Up @@ -168,16 +153,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
Expand Down Expand Up @@ -217,14 +192,17 @@ ElementState:
Status: PUBLIC
- Column:
columnId: 1
pgAttributeNum: 1
tableId: 105
Status: PUBLIC
- Column:
columnId: 2
pgAttributeNum: 2
tableId: 105
Status: PUBLIC
- PrimaryIndex:
embeddedIndex:
constraintId: 2
indexId: 1
isUnique: true
keyColumnDirections:
Expand All @@ -237,6 +215,7 @@ ElementState:
Status: PUBLIC
- SecondaryIndex:
embeddedIndex:
constraintId: 1
indexId: 2
isUnique: true
keyColumnDirections:
Expand All @@ -247,10 +226,6 @@ ElementState:
- 1
tableId: 105
Status: PUBLIC
- TableComment:
comment: __placeholder_comment__
tableId: 105
Status: PUBLIC
- ColumnName:
columnId: 1
name: a
Expand Down Expand Up @@ -280,16 +255,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
Expand All @@ -311,16 +276,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
Expand Down
Loading