Skip to content

Commit d8ab7eb

Browse files
kyleconroyclaude
andcommitted
Fix EXPLAIN children count when both options and SETTINGS present
Count EXPLAIN-level options and statement-level SETTINGS separately when both are present. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 75af8d1 commit d8ab7eb

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

internal/explain/statements.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,10 @@ func explainExplainQuery(sb *strings.Builder, n *ast.ExplainQuery, indent string
908908
if format != nil {
909909
children++
910910
}
911-
if n.HasSettings || hasSettingsAfterFormat {
911+
if n.HasSettings {
912+
children++
913+
}
914+
if hasSettingsAfterFormat {
912915
children++
913916
}
914917

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt12": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)