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

fix(planner): Fix stack overflow when applying RuleFilterPushDownJoin #9645

Merged
merged 9 commits into from
Jan 17, 2023

Conversation

leiysky
Copy link
Contributor

@leiysky leiysky commented Jan 17, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

The root cause is RuleFilterPushDownJoin will sometimes generate duplicated conjunctions when there is OR expression.

This may cause the rule RuleEliminateFilter to be incorrectly applied to the optimized expression later, generating a new expression that would be handled by RuleFilterPushDownJoin again. Thus a dead loop occurs.

Closes #9236

@vercel
Copy link

vercel bot commented Jan 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
databend ⬜️ Ignored (Inspect) Jan 17, 2023 at 8:37AM (UTC)

@leiysky leiysky requested review from xudong963 and ClSlaid January 17, 2023 06:56
@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Jan 17, 2023
@BohuTANG
Copy link
Member

[SQL] SELECT t0.actual_rowid, t6.c0, t0.c0 FROM t0 RIGHT JOIN t6 ON ((t0.actual_rowid)>=(((((t6.c0)<=(t6.c0))) IS NOT NULL)::INTEGER)) GROUP BY t0.actual_rowid, t6.c0, t0.c0 order by actual_rowid
[Diff] (-expected|+actual)
-   0 NULL 1969-12-16
-   1 NULL 1970-01-15
-   2 NULL 1970-01-11
+   0 NULL NULL
+   1 NULL NULL
+   2 NULL NULL
    3 NULL NULL
    4 NULL NULL
    5 NULL NULL
    6 NULL NULL
-   7 NULL 1970-01-23
+   7 NULL NULL
    8 NULL NULL
    9 NULL NULL
at tests/sqllogictests/suites/duckdb/issues/rigger/test_non_equality_right_join.test:46

Error: SelfError("sqllogictest failed")
Error: Process completed with exit code 1.

@mergify mergify bot merged commit 693a2f0 into databendlabs:main Jan 17, 2023
@leiysky leiysky deleted the fix-optimize branch January 18, 2023 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: thread 'mysql-query-executor' has overflowed its stack
5 participants