-
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
sql/schemachanger: properly validate NOT NULL columns #81690
Labels
A-schema-changer-impl
Related to the implementation of the new schema changer
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Comments
ajwerner
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
May 23, 2022
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
May 23, 2022
Before this change, we did not ever validate that newly added virtual computed columns which were marked NOT NULL actually were not NULL. This is because there historically, in the legacy schema changer, we'd validate the `NULL` nature of the column when performing a column backfill. In the declarative schema changer, we don't do a column backfill, so we have bugs aplenty related to the general failure to check the `NULL` disposition of the data (see cockroachdb#81679). This change only affects the legacy schema changer so that it can be backported. A separate issue (cockroachdb#81690) has been filed for parity in the declarative schema changer. Release note (bug fix): Before this change, not validation was performed when adding a virtual computed column which was marked `NOT NULL`. This meant that it was possible to have a virtual computed column with an active `NOT NULL` constraint despite having rows in the table for which the column was `NULL`. This has now been fixed.
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
May 25, 2022
Before this change, we did not ever validate that newly added virtual computed columns which were marked NOT NULL actually were not NULL. This is because there historically, in the legacy schema changer, we'd validate the `NULL` nature of the column when performing a column backfill. In the declarative schema changer, we don't do a column backfill, so we have bugs aplenty related to the general failure to check the `NULL` disposition of the data (see cockroachdb#81679). This change only affects the legacy schema changer so that it can be backported. A separate issue (cockroachdb#81690) has been filed for parity in the declarative schema changer. Release note (bug fix): Before this change, not validation was performed when adding a virtual computed column which was marked `NOT NULL`. This meant that it was possible to have a virtual computed column with an active `NOT NULL` constraint despite having rows in the table for which the column was `NULL`. This has now been fixed.
craig bot
pushed a commit
that referenced
this issue
May 31, 2022
81693: sql: enforce NOT NULL when adding a virtual computed column r=ajwerner a=ajwerner Before this change, we did not ever validate that newly added virtual computed columns which were marked NOT NULL actually were not NULL. This is because there historically, in the legacy schema changer, we'd validate the `NULL` nature of the column when performing a column backfill. In the declarative schema changer, we don't do a column backfill, so we have bugs aplenty related to the general failure to check the `NULL` disposition of the data (see #81679). This change only affects the legacy schema changer so that it can be backported. A separate issue (#81690) has been filed for parity in the declarative schema changer. Release note (bug fix): Before this change, not validation was performed when adding a virtual computed column which was marked `NOT NULL`. This meant that it was possible to have a virtual computed column with an active `NOT NULL` constraint despite having rows in the table for which the column was `NULL`. This has now been fixed. Co-authored-by: Andrew Werner <[email protected]>
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
Jun 27, 2022
Before this change, we did not ever validate that newly added virtual computed columns which were marked NOT NULL actually were not NULL. This is because there historically, in the legacy schema changer, we'd validate the `NULL` nature of the column when performing a column backfill. In the declarative schema changer, we don't do a column backfill, so we have bugs aplenty related to the general failure to check the `NULL` disposition of the data (see cockroachdb#81679). This change only affects the legacy schema changer so that it can be backported. A separate issue (cockroachdb#81690) has been filed for parity in the declarative schema changer. Release note (bug fix): Before this change, not validation was performed when adding a virtual computed column which was marked `NOT NULL`. This meant that it was possible to have a virtual computed column with an active `NOT NULL` constraint despite having rows in the table for which the column was `NULL`. This has now been fixed.
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
Jun 27, 2022
Before this change, we did not ever validate that newly added virtual computed columns which were marked NOT NULL actually were not NULL. This is because there historically, in the legacy schema changer, we'd validate the `NULL` nature of the column when performing a column backfill. In the declarative schema changer, we don't do a column backfill, so we have bugs aplenty related to the general failure to check the `NULL` disposition of the data (see cockroachdb#81679). This change only affects the legacy schema changer so that it can be backported. A separate issue (cockroachdb#81690) has been filed for parity in the declarative schema changer. Release note (bug fix): Before this change, not validation was performed when adding a virtual computed column which was marked `NOT NULL`. This meant that it was possible to have a virtual computed column with an active `NOT NULL` constraint despite having rows in the table for which the column was `NULL`. This has now been fixed.
Presently the nullness of the column is in |
postamar
added
the
A-schema-changer-impl
Related to the implementation of the new schema changer
label
Nov 10, 2022
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-changer-impl
Related to the implementation of the new schema changer
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Describe the problem
At time of writing, the declarative schema changer does not validate the
NOT NULL
nature of newly added columns. The change in #81679 captures most of what is necessary: push the logic into the index backfiller. The remaining case that needs to be covered is validating theNOT NULL
nature of virtual computed columns, which is being handled separately for the legacy schema changer.Jira issue: CRDB-16031
Epic CRDB-43310
The text was updated successfully, but these errors were encountered: