release-20.2: sql: allow for pre-19.2 foreign keys in table validation #57083
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.
Backport 2/2 commits from #57066.
/cc @cockroachdb/release
sql: allow for pre-19.2 foreign keys in table validation
We introduced a bug in v20.2 where we failed to upgrade referenced
descriptors' FK representations from pre-19.2 descriptors when
validating cross-references for tables, leading to validation failures
that would make the table unusable. This PR gets rid of the validation
errors by having
Validate()
account for pre-19.2-style foreign keys onreferenced table descriptors.
Fixes #57032.
Release note (bug fix): Fixes a bug where tables and metadata were
unavailable due to spurious
missing fk back reference
validationerrors.
catalogkv: add testing of descriptor unwrapping and validation
This commit adds a framework to test that descriptors validate properly.
It also adds testdata and a bash script to generate that test data.
This test is to exercise a problematic path whereby tables constructed
in v19.1 would fail to validate in v20.2.
Release note: None