Skip to content

Commit a26db45

Browse files
kyleconroyclaude
andcommitted
Fix DESCRIBE parsing to handle SETTINGS after FORMAT
- Swap order of FORMAT/SETTINGS parsing in DESCRIBE statement - SETTINGS can come after FORMAT clause in ClickHouse Fixes 02026_describe_include_subcolumns/stmt5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b7d0a23 commit a26db45

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

parser/parser.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6347,12 +6347,6 @@ func (p *Parser) parseDescribe() *ast.DescribeQuery {
63476347
}
63486348
}
63496349

6350-
// Parse SETTINGS clause
6351-
if p.currentIs(token.SETTINGS) {
6352-
p.nextToken()
6353-
desc.Settings = p.parseSettingsList()
6354-
}
6355-
63566350
// Parse FORMAT clause
63576351
if p.currentIs(token.FORMAT) {
63586352
p.nextToken()
@@ -6362,6 +6356,12 @@ func (p *Parser) parseDescribe() *ast.DescribeQuery {
63626356
}
63636357
}
63646358

6359+
// Parse SETTINGS clause (can come after FORMAT)
6360+
if p.currentIs(token.SETTINGS) {
6361+
p.nextToken()
6362+
desc.Settings = p.parseSettingsList()
6363+
}
6364+
63656365
return desc
63666366
}
63676367

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

0 commit comments

Comments
 (0)