-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
catalog/tabledesc: improve view validation in ValidateCrossReferences
#63147
Labels
A-schema-descriptors
Relating to SQL table/db descriptor handling.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Comments
ajwerner
added
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
A-schema-descriptors
Relating to SQL table/db descriptor handling.
labels
Apr 6, 2021
These are for views. |
ajwerner
changed the title
catalog/tabledesc: validate
catalog/tabledesc: improve view validation in Aug 3, 2021
DependsOn
and DependedOnBy
in ValidateCrossReferences
ValidateCrossReferences
In In #60775 we added code to retrieve the descriptors from these two fields but we don't do any work to check the backreferences in those descriptors. We should. Other validation missing on views:
|
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Sep 23, 2021
Previously, we did not validate the DependsOn and DependedOnBy cross-references. This commit adds this validation and also fixes a bug in which privileges were not validated for non-physical tables. Fixes cockroachdb#63147. Release note: None
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Sep 24, 2021
Previously, we did not validate the DependsOn and DependedOnBy cross-references. This commit adds this validation and also fixes a bug in which privileges were not validated for non-physical tables. Fixes cockroachdb#63147. Release note: None
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Nov 8, 2021
Previously, we did not validate the DependsOn and DependedOnBy cross-references. This commit adds this validation and also fixes a few bugs: - privileges were not validated for non-physical tables. - sequence dependencies were improperly updated by the schema changer. Fixes cockroachdb#63147. Release note: None
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Nov 11, 2021
Previously, we did not validate the DependsOn and DependedOnBy cross-references. This commit adds this validation and also fixes a few bugs: - privileges were not validated for non-physical tables. - sequence dependencies were improperly updated by the schema changer. Fixes cockroachdb#63147. Release note: None
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Jan 26, 2022
Previously, we did not validate the DependsOn and DependedOnBy cross-references. This commit adds this validation and also fixes a few bugs: - privileges were not validated for non-physical tables. - sequence dependencies were improperly updated by the schema changer. Fixes cockroachdb#63147. Release note: None
postamar
pushed a commit
to postamar/cockroach
that referenced
this issue
Jan 27, 2022
Previously, we did not validate the DependsOn, DependsOnTyoe and DependedOnBy cross-references. This commit adds this validation and also fixes a few bugs: - privileges were not validated for non-physical tables. - sequence dependencies were improperly updated by the schema changer. Unfortunately, there remain a number of unfortunate bugs around the inconsistent handling of these fields: - back-references are not systematically present. - ColumnIDs in DependedOnBy has a different meaning depending on whether the table is a sequence or not. These inconsistencies need to be ironed out by a cluster migration. This in turn will require changes to the PostRestoreChanges descriptor builder method. It probably also requires version-gating validation checks. Fixes cockroachdb#63147. Release note: None
craig bot
pushed a commit
that referenced
this issue
Feb 7, 2022
70632: tabledesc: improve view validation r=postamar a=postamar Previously, we did not validate the DependsOn and DependedOnBy cross-references. This commit adds this validation and also fixes a bug in which privileges were not validated for non-physical tables. Fixes #63147. Release note: None Co-authored-by: Marius Posta <[email protected]>
exalate-issue-sync
bot
added
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
and removed
T-sql-schema-deprecated
Use T-sql-foundations instead
labels
May 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-schema-descriptors
Relating to SQL table/db descriptor handling.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Is your feature request related to a problem? Please describe.
We don't currently validate the cross references. This is a bummer. We won't want to enforce validation of them on read because of existing bugs but we would like to prevent new errors from being created.
See
cockroach/pkg/sql/catalog/tabledesc/validate_test.go
Lines 93 to 98 in bd62e2c
Describe the solution you'd like
We should validate the cross references.
Additional context
Relates to #63065
Epic: CRDB-1519
Jira issue: CRDB-6446
The text was updated successfully, but these errors were encountered: