Skip to content

Commit 20a9515

Browse files
Merge 2e31def into blathers/backport-release-25.4-156105
2 parents 05c7afe + 2e31def commit 20a9515

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/sql/opt_catalog.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,12 +1157,13 @@ func newOptTable(
11571157
canUseTombstones := idx.ImplicitPartitioningColumnCount() == 1 &&
11581158
partitionColumn.GetType().Family() == types.EnumFamily
11591159
ot.uniqueConstraints = append(ot.uniqueConstraints, optUniqueConstraint{
1160-
name: idx.GetName(),
1161-
table: ot.ID(),
1162-
columns: idx.IndexDesc().KeyColumnIDs[idx.IndexDesc().ExplicitColumnStartIdx():],
1163-
withoutIndex: true,
1164-
canUseTombstones: canUseTombstones,
1165-
tombstoneIndexOrdinal: idx.Ordinal(),
1160+
name: idx.GetName(),
1161+
table: ot.ID(),
1162+
columns: idx.IndexDesc().KeyColumnIDs[idx.IndexDesc().ExplicitColumnStartIdx():],
1163+
withoutIndex: true,
1164+
canUseTombstones: canUseTombstones,
1165+
// One would assume that this would be idx.Ordinal(), but they can differ during schema change
1166+
tombstoneIndexOrdinal: i,
11661167
predicate: idx.GetPredicate(),
11671168
// TODO(rytaft): will we ever support an unvalidated unique constraint
11681169
// here?

0 commit comments

Comments
 (0)