You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] The plan parser drops an IF condition's own query plan (COND WITH QUERY) and a MULTIPLE PLAN statement's hashes #580
An IF condition's own query plan (StmtCond with StatementType="COND WITH QUERY").ParseStatementAndChildren (~line 160) passes each child of <Condition> back into itself. For this shape the child is a bare <QueryPlan>, not a statement, so it falls to the else branch and ParseStatement reads the QueryPlan element as if it were a statement. StatementText and StatementType come back empty (those attributes live on the StmtCond), no nested QueryPlan is found (~line 272), and the method returns the synthetic STATEMENT root (~line 319). The condition's operator tree, and every missing-index suggestion and warning the analyzer would raise on it, are lost.
StmtSimple with StatementType="MULTIPLE PLAN". It carries QueryHash and QueryPlanHash but no QueryPlan child. ParseStatement returns at the no-QueryPlan branch (~line 319) before it reads the hashes (~lines 501–502), so both come back null.
Found by reading this code against the PerformanceMonitor fix. Not yet reproduced in Performance Studio itself.
Steps to Reproduce
Capture an actual or estimated plan for a batch with an IF EXISTS (SELECT ... FROM some_table WHERE ...) condition.
Open or analyze it and look at the statement list.
Expected Behavior
The IF condition appears as its own statement, with StatementTypeCOND WITH QUERY, its operator tree, its hashes, and any warnings.
A MULTIPLE PLAN statement keeps its QueryHash and QueryPlanHash.
Actual Behavior
From the code:
The condition becomes an empty STATEMENT placeholder with no operators.
Activity
Merge pull request #581 from erikdarlingdata/fix/parser-cond-multiple…
erikdarlingdata commentedon Sep 27, 2026
Fixed by #581, merged to dev. Ships in the next release.
Parse IF-condition query plans and MULTIPLE PLAN hashes (erikdarlingd…