cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.16k stars 3.82k forks source link

sql/schemachanger: handle empty schemas gracefully #135910

Closed fqazi closed 5 hours ago

fqazi commented 9 hours ago

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.

cockroach-teamcity commented 9 hours ago

This change is Reviewable

fqazi commented 6 hours ago

@rafiss @annrpom TFTR

bors r+

craig[bot] commented 5 hours ago

Build succeeded:

blathers-crl[bot] commented 5 hours ago

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 #129676: branch-release-23.2, branch-release-24.1, branch-release-24.3.


:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.