Skip to content

Commit

Permalink
sql/schemachanger: add/fix comment related tests
Browse files Browse the repository at this point in the history
This commit is all about adding/fixing data driven tests.

Release note: None
  • Loading branch information
chengxiong-ruan committed Apr 13, 2022
1 parent 22ba279 commit aedd80f
Show file tree
Hide file tree
Showing 21 changed files with 675 additions and 2,077 deletions.
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
60 changes: 8 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 Down Expand Up @@ -88,10 +92,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 +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
Expand Down Expand Up @@ -208,10 +193,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 +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
Expand Down Expand Up @@ -337,7 +303,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 +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:
Expand Down Expand Up @@ -439,7 +395,7 @@ ElementState:
tableId: 108
Status: PUBLIC
- IndexComment:
comment: __placeholder_comment__
comment: pkey is good
indexId: 1
tableId: 108
Status: PUBLIC
Expand Down
53 changes: 0 additions & 53 deletions pkg/ccl/schemachangerccl/testdata/decomp/partitioning
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,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 +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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -247,10 +218,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 +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
Expand All @@ -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
Expand Down
Loading

0 comments on commit aedd80f

Please sign in to comment.