From 5af7e8aa89235d80ce7ae385f9a45656a7acb5f9 Mon Sep 17 00:00:00 2001 From: Brendan Gerrity Date: Fri, 31 Oct 2025 15:25:30 -0400 Subject: [PATCH] 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 --- pkg/sql/catalog/tabledesc/column.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/sql/catalog/tabledesc/column.go b/pkg/sql/catalog/tabledesc/column.go index 5ae098fc403a..2ec00ac1501d 100644 --- a/pkg/sql/catalog/tabledesc/column.go +++ b/pkg/sql/catalog/tabledesc/column.go @@ -334,8 +334,9 @@ func newColumnCache(desc *descpb.TableDescriptor, mutations *mutationCache) *col numMutations := len(mutations.columns) numDeletable := numPublic + numMutations for i := range colinfo.AllSystemColumnDescs { + desc := colinfo.AllSystemColumnDescs[i] col := column{ - desc: &colinfo.AllSystemColumnDescs[i], + desc: &desc, ordinal: numDeletable + i, } backingStructs = append(backingStructs, col)