-
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: internal error: invalid index #39433
Comments
This issue is caused by a weird combination of subqueries. It seems like one of the subqueries has an embedded subquery, and when planning the outer subquery, the inner subquery isn't yet available, or something? Here's the explain plan:
Explain opt:
|
I think the issue here is perhaps that a subquery within an apply join expects to be able to reference a subquery outside of the apply join, but it cannot because the subqueries array passed to the apply join is solely the subqueries that are contained within the apply join itself?? I don't know, I'm lost. @RaduBerinde can you take a look? Sorry for the deluge of apply join stuff that we can't figure out. |
I see.. when we construct a new plan with the execbuilder, we'd want to include the While it's important to iron out these issues, I don't think this work is a high priority unless a user runs into problems (it's a corner case of apply, which itself is a corner case). If it's impeding other sqlsmith coverage, we could add a knob for disabling apply joins and do runs with them off. |
@RaduBerinde it seems like the actionable item here is around plan creation so moving to triage in SQL Planning. |
We hit another several instances of this bug, all on sqlsmith queries (#54166), here is a reduced one:
|
Another reproduction is here. |
This commit temporarily skips failing `sqlsmith` roachtest on `internal error: invalid index` errors which are due to issues with subqueries (cockroachdb#39433) in order to reduce the noise. Release note: None
58249: roachtest: improve sqlsmith r=yuzefovich a=yuzefovich **roachtest: delay panic injection in sqlsmith** We need to delay the panic injection until after the smither is created because some queries are run during its instantiation. Fixes: #58235. Release note: None **roachtest: ignore a known issue in sqlsmith** This commit temporarily skips failing `sqlsmith` roachtest on `internal error: invalid index` errors which are due to issues with subqueries (#39433) in order to reduce the noise. Release note: None Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
This commit temporarily skips failing `sqlsmith` roachtest on `internal error: invalid index` errors which are due to issues with subqueries (cockroachdb#39433) in order to reduce the noise. Release note: None
64663: sql: fix error on ALTER/DROP TYPE on builtin type r=postamar a=postamar Previously, an assertion failure would be raised when executing a statement along the lines of: ALTER TYPE foo.GEOMETRY RENAME TO bar The name GEOMETRY is one of a handful of builtin types that warrant special treatment during name resolution. This commit instead causes a pgerror to be raised when attempting to mutate a builtin type. Fixes #64398 Release note: None 64767: sql: make error during subquery eval more specific r=yuzefovich a=yuzefovich We have a known limitation (#39433) around subqueries and apply joins, so we ignore errors that occur because of it during `sqlsmith` roachtest. This commit makes the error message a bit more specific so that we didn't mistakenly ignore other issues. Release note: None Co-authored-by: Marius Posta <marius@cockroachlabs.com> Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
The text was updated successfully, but these errors were encountered: