Skip to content

Commit 5af7e8a

Browse files
committed
sql: append copies of system column descriptors
Previously, the shared descriptors common to system columns meant changes in one could cause side-effects in another. This was of particular concern for the schema changer removing the `ColumnHidden` element during a table drop and consequently exposing the column in other tables. This change appends copies to avoid that side-effect. Part of: #139605 Release note: None
1 parent bb8844a commit 5af7e8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/sql/catalog/tabledesc/column.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ func newColumnCache(desc *descpb.TableDescriptor, mutations *mutationCache) *col
334334
numMutations := len(mutations.columns)
335335
numDeletable := numPublic + numMutations
336336
for i := range colinfo.AllSystemColumnDescs {
337+
desc := colinfo.AllSystemColumnDescs[i]
337338
col := column{
338-
desc: &colinfo.AllSystemColumnDescs[i],
339+
desc: &desc,
339340
ordinal: numDeletable + i,
340341
}
341342
backingStructs = append(backingStructs, col)

0 commit comments

Comments
 (0)