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: address bugs with column families #99953

Merged
merged 3 commits into from
Mar 30, 2023
Merged
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
10 changes: 10 additions & 0 deletions pkg/ccl/schemachangerccl/backup_base_generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions pkg/ccl/schemachangerccl/backup_base_mixed_generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
│ ├── MarkDescriptorAsDropped {"DescriptorID":108}
│ ├── RemoveObjectParent {"ObjectID":108,"ParentSchemaID":105}
│ ├── RemoveBackReferenceInTypes {"BackReferencedDescriptorID":108}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.ColumnFamil..."}
│ ├── MakePublicColumnWriteOnly {"ColumnID":1,"TableID":108}
│ ├── SetColumnName {"ColumnID":1,"Name":"crdb_internal_co...","TableID":108}
│ ├── MakePublicColumnNotNullValidated {"ColumnID":1,"TableID":108}
Expand All @@ -97,6 +96,7 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.Owner"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"admin"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"root"}
│ ├── AssertColumnFamilyIsRemoved {"TableID":108}
│ ├── MarkDescriptorAsDropped {"DescriptorID":104}
│ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":105,"Name":"public"}}
│ ├── NotImplementedForPublicObjects {"DescID":105,"ElementType":"scpb.Owner"}
Expand Down Expand Up @@ -234,7 +234,6 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
│ ├── MarkDescriptorAsDropped {"DescriptorID":108}
│ ├── RemoveObjectParent {"ObjectID":108,"ParentSchemaID":105}
│ ├── RemoveBackReferenceInTypes {"BackReferencedDescriptorID":108}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.ColumnFamil..."}
│ ├── MakePublicColumnWriteOnly {"ColumnID":1,"TableID":108}
│ ├── SetColumnName {"ColumnID":1,"Name":"crdb_internal_co...","TableID":108}
│ ├── MakePublicColumnNotNullValidated {"ColumnID":1,"TableID":108}
Expand All @@ -257,6 +256,7 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.Owner"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"admin"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"root"}
│ ├── AssertColumnFamilyIsRemoved {"TableID":108}
│ ├── RemoveColumnNotNull {"ColumnID":1,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4294967295,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4294967294,"TableID":108}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── MarkDescriptorAsDropped {"DescriptorID":108}
│ ├── RemoveObjectParent {"ObjectID":108,"ParentSchemaID":105}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.TablePartit..."}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.ColumnFamil..."}
│ ├── MakePublicColumnWriteOnly {"ColumnID":1,"TableID":108}
│ ├── SetColumnName {"ColumnID":1,"Name":"crdb_internal_co...","TableID":108}
│ ├── MakePublicColumnNotNullValidated {"ColumnID":1,"TableID":108}
Expand All @@ -62,7 +61,8 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"admin"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"root"}
│ ├── RemoveDroppedColumnType {"ColumnID":2,"TableID":108}
│ └── UpdateTableBackReferencesInTypes {"BackReferencedTableID":108}
│ ├── UpdateTableBackReferencesInTypes {"BackReferencedTableID":108}
│ └── AssertColumnFamilyIsRemoved {"TableID":108}
├── PreCommitPhase
│ ├── Stage 1 of 2 in PreCommitPhase
│ │ ├── 27 elements transitioning toward ABSENT
Expand Down Expand Up @@ -130,7 +130,6 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── MarkDescriptorAsDropped {"DescriptorID":108}
│ ├── RemoveObjectParent {"ObjectID":108,"ParentSchemaID":105}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.TablePartit..."}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.ColumnFamil..."}
│ ├── MakePublicColumnWriteOnly {"ColumnID":1,"TableID":108}
│ ├── SetColumnName {"ColumnID":1,"Name":"crdb_internal_co...","TableID":108}
│ ├── MakePublicColumnNotNullValidated {"ColumnID":1,"TableID":108}
Expand All @@ -155,6 +154,7 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── RemoveColumnNotNull {"ColumnID":2,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4294967295,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4294967294,"TableID":108}
│ ├── AssertColumnFamilyIsRemoved {"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":1,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":108}
│ ├── MakeDeleteOnlyColumnAbsent {"ColumnID":4294967295,"TableID":108}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── MarkDescriptorAsDropped {"DescriptorID":108}
│ ├── RemoveObjectParent {"ObjectID":108,"ParentSchemaID":105}
│ ├── RemoveBackReferenceInTypes {"BackReferencedDescriptorID":108}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.ColumnFamil..."}
│ ├── MakePublicColumnWriteOnly {"ColumnID":1,"TableID":108}
│ ├── SetColumnName {"ColumnID":1,"Name":"crdb_internal_co...","TableID":108}
│ ├── MakePublicColumnNotNullValidated {"ColumnID":1,"TableID":108}
Expand All @@ -48,7 +47,8 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":105}}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.Owner"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"admin"}
│ └── RemoveUserPrivileges {"DescriptorID":108,"User":"root"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"root"}
│ └── AssertColumnFamilyIsRemoved {"TableID":108}
├── PreCommitPhase
│ ├── Stage 1 of 2 in PreCommitPhase
│ │ ├── 20 elements transitioning toward ABSENT
Expand Down Expand Up @@ -101,7 +101,6 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── MarkDescriptorAsDropped {"DescriptorID":108}
│ ├── RemoveObjectParent {"ObjectID":108,"ParentSchemaID":105}
│ ├── RemoveBackReferenceInTypes {"BackReferencedDescriptorID":108}
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.ColumnFamil..."}
│ ├── MakePublicColumnWriteOnly {"ColumnID":1,"TableID":108}
│ ├── SetColumnName {"ColumnID":1,"Name":"crdb_internal_co...","TableID":108}
│ ├── MakePublicColumnNotNullValidated {"ColumnID":1,"TableID":108}
Expand All @@ -115,6 +114,7 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab
│ ├── NotImplementedForPublicObjects {"DescID":108,"ElementType":"scpb.Owner"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"admin"}
│ ├── RemoveUserPrivileges {"DescriptorID":108,"User":"root"}
│ ├── AssertColumnFamilyIsRemoved {"TableID":108}
│ ├── RemoveColumnNotNull {"ColumnID":1,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4294967295,"TableID":108}
│ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4294967294,"TableID":108}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,17 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
│ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0}
│ │ │ │ PUBLIC → ABSENT
│ │ │ │
│ │ │ └── • Precedence dependency from DROPPED Table:{DescID: 108}
│ │ │ rule: "descriptor dropped before dependent element removal"
│ │ │ ├── • Precedence dependency from DROPPED Table:{DescID: 108}
│ │ │ │ rule: "descriptor dropped before dependent element removal"
│ │ │ │
│ │ │ ├── • Precedence dependency from ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}
│ │ │ │ rule: "column type removed before column family"
│ │ │ │
│ │ │ ├── • Precedence dependency from ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}
│ │ │ │ rule: "column type removed before column family"
│ │ │ │
│ │ │ └── • Precedence dependency from ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}
│ │ │ rule: "column type removed before column family"
│ │ │
│ │ ├── • Column:{DescID: 108, ColumnID: 1}
│ │ │ │ PUBLIC → WRITE_ONLY
Expand Down Expand Up @@ -407,10 +416,6 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
│ │ TypeIDs:
│ │ - 106
│ │
│ ├── • NotImplementedForPublicObjects
│ │ DescID: 108
│ │ ElementType: scpb.ColumnFamily
│ │
│ ├── • MakePublicColumnWriteOnly
│ │ ColumnID: 1
│ │ TableID: 108
Expand Down Expand Up @@ -503,6 +508,9 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
│ │ DescriptorID: 108
│ │ User: root
│ │
│ ├── • AssertColumnFamilyIsRemoved
│ │ TableID: 108
│ │
│ ├── • MarkDescriptorAsDropped
│ │ DescriptorID: 104
│ │
Expand Down Expand Up @@ -997,8 +1005,17 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
│ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0}
│ │ │ │ PUBLIC → ABSENT
│ │ │ │
│ │ │ └── • Precedence dependency from DROPPED Table:{DescID: 108}
│ │ │ rule: "descriptor dropped before dependent element removal"
│ │ │ ├── • Precedence dependency from DROPPED Table:{DescID: 108}
│ │ │ │ rule: "descriptor dropped before dependent element removal"
│ │ │ │
│ │ │ ├── • Precedence dependency from ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}
│ │ │ │ rule: "column type removed before column family"
│ │ │ │
│ │ │ ├── • Precedence dependency from ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}
│ │ │ │ rule: "column type removed before column family"
│ │ │ │
│ │ │ └── • Precedence dependency from ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}
│ │ │ rule: "column type removed before column family"
│ │ │
│ │ ├── • Column:{DescID: 108, ColumnID: 1}
│ │ │ │ PUBLIC → ABSENT
Expand Down Expand Up @@ -1181,10 +1198,6 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
│ │ TypeIDs:
│ │ - 106
│ │
│ ├── • NotImplementedForPublicObjects
│ │ DescID: 108
│ │ ElementType: scpb.ColumnFamily
│ │
│ ├── • MakePublicColumnWriteOnly
│ │ ColumnID: 1
│ │ TableID: 108
Expand Down Expand Up @@ -1277,6 +1290,9 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
│ │ DescriptorID: 108
│ │ User: root
│ │
│ ├── • AssertColumnFamilyIsRemoved
│ │ TableID: 108
│ │
│ ├── • RemoveColumnNotNull
│ │ ColumnID: 1
│ │ TableID: 108
Expand Down
Loading