Skip to content

Query running forever #5705

Answered by rdmarsh2
powerthe900 asked this question in Q&A
Discussion options

You must be logged in to vote

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 as a() or (b() and c()). In this case, since fc.getTarget().getQualifiedName() = "accept" doesn't set any requirements for the other variables, you'll get every possible combination of ConvertInstruction and two types, plus the results you were expecting where fc is a call to accept4.

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 

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rdmarsh2
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4909 on April 16, 2021 21:02.