Skip to content
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

Segmentation fault on query with "Engine=Merge + ALL INNER JOIN + WHERE with OR" #55272

Closed
floxard opened this issue Oct 6, 2023 · 3 comments · Fixed by #55353
Closed

Segmentation fault on query with "Engine=Merge + ALL INNER JOIN + WHERE with OR" #55272

floxard opened this issue Oct 6, 2023 · 3 comments · Fixed by #55353
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release crash Crash / segfault / abort major v23.3-affected v23.8-affected

Comments

@floxard
Copy link

floxard commented Oct 6, 2023

this query:

SELECT *
FROM merge('system', '^one$') AS one
ALL INNER JOIN
(
SELECT *
FROM system.one
) AS subquery ON one.dummy = subquery.dummy
WHERE (one.dummy = 0) OR (one.dummy = 1)

produces segmentation fault of ClickHouse

proof (latest version): https://fiddle.clickhouse.com/5ca1d3c3-de60-48fd-ad5f-2c7316139c60

@floxard floxard added the potential bug To be reviewed by developers and confirmed/rejected. label Oct 6, 2023
@den-crane den-crane added bug Confirmed user-visible misbehaviour in official release crash Crash / segfault / abort v23.3-affected v23.8-affected and removed potential bug To be reviewed by developers and confirmed/rejected. labels Oct 6, 2023
@floxard
Copy link
Author

floxard commented Oct 6, 2023

update: bug can be triggered without JOIN: https://fiddle.clickhouse.com/f55800f9-f432-4a4b-a9cf-40f8ba4ddcdf

@ucasfl
Copy link
Collaborator

ucasfl commented Oct 8, 2023

It's related to #42889.

@saippuakauppias
Copy link

saippuakauppias commented Oct 9, 2023

Also, @floxard found an undocumented feature that allows fix it: optimize_min_equality_disjunction_chain_length

https://fiddle.clickhouse.com/b068689d-228f-4fc2-a035-9117bb2d7824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release crash Crash / segfault / abort major v23.3-affected v23.8-affected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants