adapter: decide cluster restriction by schema identity, not name#37645
Merged
ggevay merged 1 commit intoJul 15, 2026
Merged
Conversation
check_cluster_restrictions classified an item as a system item by matching its bare schema name against the system schema names. A user-created schema named information_schema, the one system schema name not blocked by the mz_/pg_ prefix reservation, therefore let user objects be queried from the mz_catalog_server cluster. Check the item's schema specifier instead, which identifies the ambient system schemas regardless of name collisions, matching how auto_run_on_catalog_server already decides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mtabebe
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes SQL-434
Motivation
The
mz_catalog_servercluster is reserved for system catalog queries, so user objects must not be queryable from it.check_cluster_restrictionsdecided whether an item is a system item by matching its bare schema name against the system schema names. A user-created schema namedinformation_schema, the one system schema name not blocked by themz_/pg_prefix reservation, therefore let user objects slip past the restriction and run onmz_catalog_server.Description
Decide by the schema's identity instead of its name: check the item's
SchemaSpecifierwithSessionCatalog::is_system_schema_specifier, which resolves against the ambient system schemas' IDs. A name-colliding user schema has a user schema ID and is now correctly rejected. This matches howauto_run_on_catalog_serverin the same module already makes the decision.🤖 Generated with Claude Code