-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optbuilder: always select tombstone index using the index ordinal
Previously, the index to which tombstones would be written to enforce uniqueness was chosen using the ordinal of uniqueness constraint, which happens to be the same as the index ordinal if no non-unique indexes precede the unique indexes on a relation. However, if a non-unique index precedes a unique index, we will erroneously apply the uniqueness check to that index. In most cases, this will cause queries to fail on an assertion within the row helper code. However, a mixture of serializable and non-serializable mutations and some sequences of index additions and non-serializable mutations can cause uniqueness to be violated. This impacts all regional by row tables with uniqueness constraints that do not include the region which are mutated under non-serializable isolations. This patch plumbs through the index ordinal so that the proper index will be checked for uniqueness in all cases. Fixes: #137341 Release note (bug fix): Regional by row tables with uniqueness constraints where the region is not part of those uniqueness constraints and which also contain non-unique indices will now have that uniqueness properly enforced when modified at READ-COMMITTED isolation. This bug was introduced in release 24.3.0.
- Loading branch information
Showing
5 changed files
with
104 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters