You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR teaches the deparser to emit SHOW statements, choosing between the bare SHOW ALL form for the lowercase all sentinel and quoted identifier output (via QuoteUtils.quoteDottedName) for regular parameter names, including dotted GUC names. Fixtures and snapshot tests cover the quoting cases.
Files
Change
packages/deparser/src/deparser.ts
Adds the VariableShowStmt handler emitting SHOW ALL or quoted/dotted identifier form
No actionable comments were generated in the recent review.
Walkthrough
The deparser recognizes lowercase all in SHOW statements. It quotes dotted setting names and splits overlength names at eligible dots. Sixteen SQL fixtures and a pretty-print test cover the formatting and the error for an unsplittable overlength name.
Changes: SHOW identifier quoting
Layer / File(s)
Summary
SHOW formatting and fixture coverage packages/deparser/src/deparser.ts, __fixtures__/kitchen-sink/misc/show-quoting.sql, packages/deparser/__tests__/kitchen-sink/misc-show-quoting.test.ts, packages/deparser/__tests__/pretty/show-quoting.test.ts
VariableShowStmt recognizes lowercase all and quotes dotted-name segments. It splits overlength names at eligible dots and throws an error when no eligible dot exists. Sixteen SQL fixtures and a pretty-print test cover these cases.
This change quotes SHOW setting names so case and special characters survive a parse and deparse round trip. No outstanding merge-blocking issues were found.
Security architecture risk: Minimal · up to ebbcd
The change affects SHOW statement rendering and a narrow error case. No introduced or worsened risk to privileges, persistent state, or failure containment was established.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The demonstrated exposure is caller-provided AST data reaching generated SHOW text through existing APIs. The inspected change adds neither a database execution sink nor identity, credential, or persistent-state operations; downstream execution remains outside the inspected scope.
Trust Boundaries and Controls
observed — At the name-to-SQL boundary, emitted components now pass through identifier quoting rather than raw interpolation. The helper permits only restricted identifier characters without quotes and doubles embedded double quotes when quoting is required.
Resilience and Maintainability Implications
observed — The new splitting transition uses local variables and either returns a completed SHOW string or throws. The enclosing deparse path propagates the error, and deparseQuery assembles its return value only after node processing completes, so this failure does not return a partial SQL batch.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(deparser): quote SHOW variable names" matches the main change. The deparser now emits SHOW ALL only for the lowercase name all, and it quotes other SHOW names, including dotted names,…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(deparser): quote SHOW variable names" matches the main change. The deparser now emits SHOW ALL only for the lowercase name all, and it quotes other SHOW names, including dotted names, instead of emitting them unchanged. The change also splits names longer than 63 UTF-8 bytes at a dot, and the title does not mention that part. That omission is acceptable because the title does not need to cover every detail.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
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
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.
Summary
VariableShowStmtemittednode.nameraw and compared it against'ALL', but the parser lowercases unquoted names. As a result:Now:
name === 'all'→SHOW ALL; otherwise the name is emitted withQuoteUtils.quoteDottedName(name.split('.')). Fixtures added.This is a fresh version of one of the 7 fixes bundled in #368, part of constructive-io/constructive-planning#2555.
Implemented in session Triage stale open PRs and issues in parser repos
Review with Devin · Open in Devin Desktop
Summary by CodeRabbit
SHOWstatements now preserve appropriate quoting for quoted, unquoted, and qualified names, including multiword settings.allis recognized asSHOW ALL, matching uppercaseALL.