Skip to content

Commit

Permalink
tabledesc: Relaxed postDeserializationChanges
Browse files Browse the repository at this point in the history
Previously, in post deserialization changes, we deduplicate column IDs
in a sequence's back references. In particular, if there are any
0-valued column IDs, we remove them altogether unless this is the only
column ID in the reference. This commit removed that to allow a ref
with column ids like "[0, 2]".
  • Loading branch information
Xiang-Gu authored and aadityasondhi committed Aug 26, 2022
1 parent 97db4b2 commit 0a648c1
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pkg/sql/catalog/tabledesc/table_desc_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,6 @@ func maybeRemoveDuplicateIDsInRefs(d *descpb.TableDescriptor) (hasChanged bool)
for i := range d.DependedOnBy {
ref := &d.DependedOnBy[i]
s := catalog.MakeTableColSet(ref.ColumnIDs...).Ordered()
// Also strip away O-IDs, which may have made their way in here in the past.
// But only strip them if they're not the only ID. Otherwise this will
// make for an even more confusing validation failure (we check that IDs
// are not zero).
if len(s) > 1 && s[0] == 0 {
s = s[1:]
}
if len(s) < len(ref.ColumnIDs) {
ref.ColumnIDs = s
hasChanged = true
Expand Down

0 comments on commit 0a648c1

Please sign in to comment.