release-23.2: sql/schemachanger: handle empty schemas gracefully #135925
+22
−2
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 1/1 commits from #135910 on behalf of @fqazi.
/cc @cockroachdb/release
Previously, when running CREATE SCHEMA in the declartive schema changer empty schema names with end up with an assertion failure error. This was because the declarative schema change code did not handle these cases properly. When an empty schema is specified ideally a syntax error should be generated. To address this, this patch will generate the correct errors and adds logic tests.
Fixes: #129676
Release note (bug fix): CREATE SCHEMA now returns the correct error if a the schema name is missing.
Release justification: low risk fix for a bug that produces incorrect errors