-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: CTE causes panic that crashes nodes #87733
Comments
The query plan looks like this:
The problem originates when planning the right side of the apply-join:
When this expression is re-planned, the statistics builder tries to determine the column statistics for cockroach/pkg/sql/opt/exec/execbuilder/relational.go Lines 1032 to 1039 in 1540ea8
I think the solution is to add all WITH expressions to the metadata if there is any WITH scan in the right side of the join. Another issue is that the apply-join code can crash a node because some of the function calls outside of |
A user has reported that a statement with multiple CTEs can cause panics that crash a node. The crash is reproducible on v21.2, v22.1, and a recent build off of
master
. We need to determine:To reproduce:
Error message:
Jira issue: CRDB-19505
The text was updated successfully, but these errors were encountered: