-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: some schema changes use incorrect mutable descriptor #79704
Description
Describe the problem
The Mutable form of descriptors track internally the "original" version of the descriptor. This is useful for various things, including the split calculation done in #77337. When the mutable form of the descriptor is always retrieved from the collection, the "original" version will be properly maintained. There are, for better or for worse, other ways to get your hands on a mutable descriptor. In particular, one can use a Builder to get from an immutable to a mutable. Sadly, when you do that, you lose the history of the descriptor.
One example of this bug was #79561.
Generally, detecting this bug turns out to be easy: #79580
Unfortunately, there are other cases where we'd hit this issue. One is here:
Line 101 in d61df4c
| func (p *planner) forEachMutableTableInDatabase( |
Additional context
This is loosely related to #64673.
Jira issue: CRDB-14986