sql: foreign key should skip internal column in a hash-sharded pk#162608
Open
eric-alton wants to merge 1 commit intocockroachdb:masterfrom
Open
sql: foreign key should skip internal column in a hash-sharded pk#162608eric-alton wants to merge 1 commit intocockroachdb:masterfrom
eric-alton wants to merge 1 commit intocockroachdb:masterfrom
Conversation
Previously, an error would occur when defining a foreign key which references a hash-sharded primary key without explicitly providing the primary key columns. The parser was incorrectly including the internal shard key column when identifying the columns to use from the primary index. To address this, we now skip over the internal shard column when defining a foreign key. Epic: CRDB-58150 Fixes: cockroachdb#161618 Release note (bug fix): Fixed a bug where an error would occur when defining a foreign key on a hash-sharded primary key without explicitly providing the primary key columns.
Contributor
|
Merging to
|
Member
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, an error would occur when defining a foreign key which references a hash-sharded primary key without explicitly providing the primary key columns. The parser was incorrectly including the internal shard key column when identifying the columns to use from the primary index.
To address this, we now skip over the internal shard column when defining a foreign key.
Epic: CRDB-58150
Fixes: #161618
Release note (bug fix): Fixed a bug where an error would occur when defining a foreign key on a hash-sharded primary key without explicitly providing the primary key columns.