Skip to content

parser: remove dead raw_parser NULL guard - #1884

Open
920032148 wants to merge 1 commit into
IvorySQL:masterfrom
920032148:cleanup-raw-parser-null-guard
Open

parser: remove dead raw_parser NULL guard#1884
920032148 wants to merge 1 commit into
IvorySQL:masterfrom
920032148:cleanup-raw-parser-null-guard

Conversation

@920032148

@920032148 920032148 commented Sep 6, 2026

Copy link
Copy Markdown

This PR removes the unreachable NULL guard in raw_parser().

sql_raw_parser is initialized to a valid parser and is not reset in normal flow, so the branch cannot be hit. Keeping only the direct call makes the code simpler and avoids a misleading error path.

No functional tests were run; this is a code-quality cleanup only.

Summary by CodeRabbit

  • Behavior Changes
    • Removed the controlled error handling for an unavailable SQL parser hook.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 7f5c50c6-da5d-4c42-b914-571135634abd

📥 Commits

Reviewing files that changed from the base of the PR and between 375aa37 and 01ea2b2.

📒 Files selected for processing (1)
  • src/backend/parser/parser.c
💤 Files with no reviewable changes (1)
  • src/backend/parser/parser.c

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

raw_parser no longer validates sql_raw_parser before invocation. A NULL hook now causes direct function-pointer invocation instead of a SYSTEM_ERROR with a configuration hint.

Changes

Parser hook behavior

Layer / File(s) Summary
Direct SQL parser hook invocation
src/backend/parser/parser.c
raw_parser calls sql_raw_parser directly. The previous NULL check and SYSTEM_ERROR report were removed.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 01ea2

The change removes an unreachable parser-hook guard and directly invokes the initialized parser hook. No concrete merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the unused NULL guard from raw_parser.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant