Skip to content

Fix raw_expression_tree_walker for ColumnRefOrFuncCall (issue #1182) - #1184

Merged
gaoxueyu merged 1 commit into
IvorySQL:IVORY_REL_5_STABLEfrom
yuanyl630:fix/1182
Feb 10, 2026
Merged

gaoxueyu merged 1 commit into
IvorySQL:IVORY_REL_5_STABLEfrom
yuanyl630:fix/1182

Conversation

@yuanyl630

@yuanyl630 yuanyl630 commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

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! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed 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.

❤️ Share

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

@gaoxueyu
gaoxueyu merged commit c88f29a into IvorySQL:IVORY_REL_5_STABLE Feb 10, 2026
6 checks passed
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.

2 participants