Repository navigation
mcp: check TABLE, CTE-shadowed and ID-form references in catalog query validation - #40522
Merged
Merged
Conversation
Contributor
|
This PR includes three changes from #40384: collecting |
jasonhernandez
requested changes
Nov 6, 2026
jasonhernandez
left a comment
Contributor
There was a problem hiding this comment.
Let's make sure @playb0t has coauthor credits on this bugfix
…y validation Co-authored-by: Alex Gercog <[email protected]>
bobbyiliev
force-pushed
the
mcp-catalog-query-refs
branch
from
November 6, 2026 09:47
aa18a12 to
57713f5
Compare
Contributor
Author
|
Thanks, added the co-author trailer to the commit and the PR body. |
jubrad
approved these changes
Nov 6, 2026
bobbyiliev
requested review from
jasonhernandez
and removed request for
jasonhernandez
November 6, 2026 17:04
jasonhernandez
approved these changes
Nov 6, 2026
jasonhernandez
left a comment
Contributor
There was a problem hiding this comment.
thanks @playb0t and @bobbyiliev!
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.
query_system_catalogvalidation missed three ways to name a user object:TABLE t, a schema-qualified name that matches a CTE (WITH t AS (...) SELECT * FROM public.t), and ID-form names ([u1 AS mz_catalog.mz_tables]), which resolve by ID and ignore the name. This collectsTABLEreferences, only lets CTE names shadow unqualified names, and rejects ID-form names. It also accepts validTABLEandWITH MUTUALLY RECURSIVEcatalog queries that were rejected before. Based on #40384.Tests: two unit tests in
mcp.rsand five cases intestdata/mcp/developer.Co-authored-by: Alex Gercog [email protected]