Query running forever #5705
-
I was running a query on a project and it is stuck on Running query: Stage 10/10 - computing '#select#ff' for hours. I tried different projects and the same thing happened. My query is
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
It looks like you're missing some parentheses around the I'd recommend using the autoformatter (alt+shift+F in the VS Code extension) to make these kinds of mistakes more obvious. In this particular case, the formatted code would look like this: from ConvertInstruction conv, Type inputType, Type outputType, FunctionCall fc
where
fc.getTarget().getQualifiedName() = "accept"
or
fc.getTarget().getQualifiedName() = "accept4" and
conv.getEnclosingFunction().calls(fc.getTarget()) and
isNarrowingConversion(conv) and And the fixed code would look like this: from ConvertInstruction conv, Type inputType, Type outputType, FunctionCall fc
where
(
fc.getTarget().getQualifiedName() = "accept"
or
fc.getTarget().getQualifiedName() = "accept4"
) and
conv.getEnclosingFunction().calls(fc.getTarget()) and
isNarrowingConversion(conv) and |
Beta Was this translation helpful? Give feedback.
-
This issue is stale because it has been open 14 days with no activity. Comment or remove the |
Beta Was this translation helpful? Give feedback.
It looks like you're missing some parentheses around the
or
, which is leading to an unconstrained join (also called a Cartesian product) across multiple tables. In CodeQL,a() or b() and c()
is parsed asa() or (b() and c())
. In this case, sincefc.getTarget().getQualifiedName() = "accept"
doesn't set any requirements for the other variables, you'll get every possible combination ofConvertInstruction
and two types, plus the results you were expecting wherefc
is a call toaccept4
.I'd recommend using the autoformatter (alt+shift+F in the VS Code extension) to make these kinds of mistakes more obvious. In this particular case, the formatted code would look like this: