Skip to content

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

Merged
gaoxueyu merged 1 commit into
IvorySQL:masterfrom
yuanyl630:master
Feb 10, 2026
Merged

gaoxueyu merged 1 commit into
IvorySQL:masterfrom
yuanyl630:master

Conversation

@yuanyl630

@yuanyl630 yuanyl630 commented Feb 3, 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 tree traversal logic for improved code efficiency.

Note: This release contains internal code improvements with no user-facing changes or new functionality.

@coderabbitai

coderabbitai Bot commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Modified raw_expression_tree_walker_impl in the tree walker to handle T_ColumnRefOrFuncCall nodes by directly using a ColumnRefOrFuncCall struct instead of dereferencing through a FuncCall pointer. Simplified traversal logic to conditionally walk only cref and func members when present, eliminating walks to nested function attributes.

Changes

Cohort / File(s) Summary
ColumnRefOrFuncCall Traversal Refactoring
src/backend/nodes/nodeFuncs.c
Updated raw_expression_tree_walker_impl to work directly with ColumnRefOrFuncCall struct rather than dereferencing through function pointer. Simplified conditional traversal to walk only cref and func members when they exist, removing traversals of args, agg_order, agg_filter, and over attributes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 Through nodes we hop with springy grace,
ColumnRefOrFuncCall finds its place!
No tangled dereferencing quest,
Just walk thy members—simpler is best! ✨

🚥 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 'Fix raw_expression_tree_walker for ColumnRefOrFuncCall (issue #1182)' clearly and specifically summarizes the main change: fixing a bug in the tree walker for a specific node type, referencing the related issue.
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.

@yuanyl630

Copy link
Copy Markdown
Contributor Author

This PR includes the fixing codes from submitted patch of issue# 1182 and adds NULL checks.

@gaoxueyu
gaoxueyu merged commit f574049 into IvorySQL:master Feb 10, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this to Backlog in IvorySQL 5.3 Mar 12, 2026
@gaoxueyu gaoxueyu moved this from Backlog to Done in IvorySQL 5.3 Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants