Skip to content

sql: report error when db provided in show regions stmts does not exist#161014

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
eric-alton:113782_show_region
Jan 14, 2026
Merged

sql: report error when db provided in show regions stmts does not exist#161014
craig[bot] merged 1 commit intocockroachdb:masterfrom
eric-alton:113782_show_region

Conversation

@eric-alton
Copy link
Contributor

Previously, the SHOW REGIONS and SHOW SUPER REGIONS statements would succeed when provided a database name that does not exist.

This commit aligns the behavior of these statements with other SHOW statements and returns a database does not exist error when appropriate.

Epic: none
Fixes: #113782
Release note (bug fix): An error will now be reported when the database provided in a SHOW REGIONS or SHOW SUPER REGIONS statement does not exist. This bug was present since version 21.1.

Previously, the SHOW REGIONS and SHOW SUPER REGIONS statements would
succeed when provided a database name that does not exist.

This commit aligns the behavior of these statements with other SHOW
statements and returns a database does not exist error when appropriate.

Epic: none
Fixes: cockroachdb#113782
Release note (bug fix): An error will now be reported when the database
provided in a SHOW REGIONS or SHOW SUPER REGIONS statement does not exist.
This bug was present since version 21.1.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@eric-alton eric-alton requested a review from rafiss January 14, 2026 15:02
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! whenever you're ready, this can be merged by writing bors r+ in a github comment, on a line with no other text.

@rafiss made 2 comments.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @eric-alton).


pkg/ccl/logictestccl/testdata/logic_test/multi_region line 1736 at r1 (raw file):


statement error database "Delimited DB 113782" does not exist
SHOW SUPER REGIONS FROM DATABASE "Delimited DB 113782"

thanks for adding good edge-case testing here! mixed-case and whitespace-containing names are a common source of bugs when it comes to implementing our introspection queries.

@eric-alton eric-alton marked this pull request as ready for review January 14, 2026 15:04
@eric-alton eric-alton requested a review from shghasemi January 14, 2026 15:11
Copy link
Contributor

@shghasemi shghasemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@shghasemi reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @eric-alton).

@eric-alton
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 14, 2026

@craig craig bot merged commit 1d22974 into cockroachdb:master Jan 14, 2026
28 checks passed
@eric-alton eric-alton deleted the 113782_show_region branch February 4, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiregion: SHOW REGION FROM DATABASE should error if user passes database that does not exist

4 participants