-
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: avoid invalid SQL in raw_config_sql
in crdb_internal.zones
#137584
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Previously, we could include an invalid `ALTER ... CONFIGURE ZONE USING;` stmt in the `raw_config_sql` column of `crdb_internal.zones`. This was the case when some of the config was inherited and we didn't want to include it for the corresponding object. The contract of this virtual tables allows NULLs in this column, so this commit returns NULL in such cases. Note that I spent non-trivial amount of time trying to figure out how we could end up in this situation but was unsuccessful. This invalid stmt was included into the output of SHOW CREATE TABLE which, among other things, we use when recreating the bundle, so we should now have easier time recreating multi-region bundles. Release note: None
647438a
to
e862503
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR! bors r+ |
Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches. Issue #123904: branch-release-23.2, branch-release-24.1, branch-release-24.2, branch-release-24.3. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Previously, we could include an invalid
ALTER ... CONFIGURE ZONE USING;
stmt in theraw_config_sql
column ofcrdb_internal.zones
. This was the case when some of the config was inherited and we didn't want to include it for the corresponding object. The contract of this virtual tables allows NULLs in this column, so this commit returns NULL in such cases. Note that I spent non-trivial amount of time trying to figure out how we could end up in this situation but was unsuccessful.This invalid stmt was included into the output of SHOW CREATE TABLE which, among other things, we use when recreating the bundle, so we should now have easier time recreating multi-region bundles.
Fixes: #123904.
Release note: None