Skip to content

Fix unrecognized node type in ALTER COLUMN DEFAULT int4range expressions#8606

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-unrecognized-node-type-error
Draft

Fix unrecognized node type in ALTER COLUMN DEFAULT int4range expressions#8606
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-unrecognized-node-type-error

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

DESCRIPTION: Fix ALTER COLUMN DEFAULT handling for raw/transformed expressions

Copilot AI changed the title [WIP] Fix unrecognized node type error during ALTER TABLE with int4range Fix unrecognized node type in ALTER COLUMN DEFAULT int4range expressions Jun 3, 2026
Copilot AI requested a review from ihalatci June 3, 2026 11:11
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.19048% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.73%. Comparing base (f31fe24) to head (fcfc2c9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8606      +/-   ##
==========================================
+ Coverage   87.99%   88.73%   +0.74%     
==========================================
  Files         288      288              
  Lines       64382    64399      +17     
  Branches     8108     8112       +4     
==========================================
+ Hits        56650    57145     +495     
+ Misses       5381     4912     -469     
+ Partials     2351     2342       -9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The previous change made contain_nextval_expression_walker recurse via
raw_expression_tree_walker so that raw ALTER COLUMN ... SET DEFAULT
expressions (e.g. int4range) could be traversed. However most callers
(planner, executor, modification paths) pass fully analyzed expression
trees, and raw_expression_tree_walker errors out on analyzed-only nodes
such as TargetEntry/OpExpr with "unrecognized node type", breaking a
large number of distributed query suites.

Route each node to the correct walker instead: raw grammar nodes (and the
primitive value nodes they contain) are descended with
raw_expression_tree_walker, while shared and fully analyzed nodes go
through expression_tree_walker. This keeps the raw FuncCall(nextval)
detection working for SET DEFAULT while restoring analyzed-tree traversal
for all other callers.

Also apply citus_indent formatting to table.c.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Unrecognized Node Type (119) Error during ALTER TABLE with Complex int4range Expressions

3 participants