Skip to content

Remove unused WalkQueryTree overload in ORCA - #2189

Merged
tuhaihe merged 2 commits into
apache:mainfrom
tuhaihe:fix-orca-walker-cast
Oct 27, 2026
Merged

tuhaihe merged 2 commits into
apache:mainfrom
tuhaihe:fix-orca-walker-cast

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Oct 26, 2026

Copy link
Copy Markdown
Member

gpdb::WalkQueryTree() had two overloads: one taking a typed walker, bool (*)(Node *, void ), which calls query_tree_walker_wrapper(), and one taking bool ()(), added with row level security support in 80a26c8, which passes it straight to the query_tree_walker() macro. In C++ an empty parameter list means no parameters, so the macro's cast to tree_walker_callback trips -Wcast-function-type on every build:

  nodeFuncs.h:162:35: warning: cast between incompatible function types
  from 'bool (*)()' to 'tree_walker_callback'

Both callers already pass a bool (*)(Node *, void ): CQueryMutators' ExprWalkerFn is BOOL ()(Node *, void *), and BOOL is bool. They resolve to the typed overload, and the other one has no callers. Remove it.

Assisted-by: Claude Code

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


gpdb::WalkQueryTree() had two overloads: one taking a typed walker,
bool (*)(Node *, void *), which calls query_tree_walker_wrapper(), and
one taking bool (*)(), added with row level security support in
80a26c8, which passes it straight to the query_tree_walker() macro.
In C++ an empty parameter list means no parameters, so the macro's cast
to tree_walker_callback trips -Wcast-function-type on every build:

  nodeFuncs.h:162:35: warning: cast between incompatible function types
  from 'bool (*)()' to 'tree_walker_callback'

Both callers already pass a bool (*)(Node *, void *): CQueryMutators'
ExprWalkerFn is BOOL (*)(Node *, void *), and BOOL is bool. They resolve
to the typed overload, and the other one has no callers. Remove it.

Assisted-by: Claude Code
@tuhaihe tuhaihe mentioned this pull request Oct 26, 2026
1 of 13 tasks
@tuhaihe tuhaihe added this to the 3.0 milestone Oct 26, 2026

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, right now we use only properly-typed bool (*)(Node *, void *) in src/include/gpopt/gpdbwrappers.h:595 and / src/backend/gpopt/gpdbwrappers.cpp:1758

So unused one could be deleted.

maybe the author want to use it later, but we will never know, let's delete it

@tuhaihe tuhaihe modified the milestones: 3.0, 3.x Meson Oct 27, 2026
@tuhaihe
tuhaihe enabled auto-merge (rebase) October 27, 2026 05:59
@tuhaihe
tuhaihe merged commit 0fd267e into apache:main Oct 27, 2026
120 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.

4 participants