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
{{ message }}
Repository navigation
Fix raw_expression_tree_walker for ColumnRefOrFuncCall (issue #1182) - #1184
This commit fixes raw_expression_tree_walker_impl() handling of T_ColumnRefOrFuncCall.
Previously it only walked into colf->func’s members (e.g., args, agg_order, agg_filter, over) and did not WALK(colf->func) itself, so walker callbacks could not observe the FuncCall node when it was wrapped by ColumnRefOrFuncCall (Oracle parser output).
The new logic walks both children explicitly: colf->cref and colf->func (with NULL checks). This makes raw tree traversal complete and consistent with other node cases, and allows callbacks to correctly find FuncCall nodes under ColumnRefOrFuncCall, addressing issue #1182.
Summary by CodeRabbit
Refactor
Optimized internal expression evaluation logic for improved handling of complex database queries.
Modified the T_ColumnRefOrFuncCall node handling in raw_expression_tree_walker_impl to cast the node to ColumnRefOrFuncCall type and traverse cref and func fields directly, instead of extracting function-call-specific subfields (args, agg_order, agg_filter, over) for traversal.
Changes
Cohort / File(s)
Summary
Tree Walker Refactoring src/backend/nodes/nodeFuncs.c
Refactored T_ColumnRefOrFuncCall node traversal to use direct casting and conditional traversal of cref and func structures instead of unconditionally traversing internal FuncCall subfields, narrowing the walk scope for this node type.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Issue #1182: This PR directly implements the fix suggested in the issue by updating raw_expression_tree_walker_impl to cast to ColumnRefOrFuncCall and walk colf->cref and colf->func as proposed.
Poem
🐰 A hop through the nodes, so precise and so neat, The walker now traverses with surgical feet, No more wandering through fields that don't bind, Just cref and func—leaving clutter behind! ✨
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title accurately describes the main change: fixing raw_expression_tree_walker for ColumnRefOrFuncCall nodes with reference to the related issue number.
Docstring Coverage
✅ Passed
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Create PR with unit tests
Post copyable unit tests in a comment
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.
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.
This commit fixes raw_expression_tree_walker_impl() handling of T_ColumnRefOrFuncCall.
Previously it only walked into colf->func’s members (e.g., args, agg_order, agg_filter, over) and did not WALK(colf->func) itself, so walker callbacks could not observe the FuncCall node when it was wrapped by ColumnRefOrFuncCall (Oracle parser output).
The new logic walks both children explicitly: colf->cref and colf->func (with NULL checks). This makes raw tree traversal complete and consistent with other node cases, and allows callbacks to correctly find FuncCall nodes under ColumnRefOrFuncCall, addressing issue #1182.
Summary by CodeRabbit