Skip to content

opt: fix panic with empty column sets in set operations #150706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuzefovich
Copy link
Member

Fix panic "column statistics cannot be determined for empty column set" when performing set operations (UNION, INTERSECT, EXCEPT) on tables with no columns (e.g., created with "SELECT ALL").

Relatedly, relax the "invalid union" assertion in
CanConvertUnionToDistinctUnionAll that incorrectly assumed that we will never have an operation with no columns.

Fixes #130593

Release note: None

🤖 Generated with Claude Code

Fix panic "column statistics cannot be determined for empty column set"
when performing set operations (UNION, INTERSECT, EXCEPT) on tables
with no columns (e.g., created with "SELECT ALL").

Relatedly, relax the "invalid union" assertion in
CanConvertUnionToDistinctUnionAll that incorrectly assumed that we will
never have an operation with no columns.

Fixes cockroachdb#130593

Release note: None

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.

sql: Internal Error with empty column set
2 participants