Skip to content

Commit a9e48cb

Browse files
kyleconroyclaude
andcommitted
Handle IF NOT EXISTS in CREATE WORKLOAD parsing
- Skip IF NOT EXISTS after WORKLOAD keyword before parsing name - Fixes 03232_workload_create_and_drop/stmt3 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8738b5d commit a9e48cb

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

parser/parser.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3758,6 +3758,17 @@ func (p *Parser) parseCreateWorkload(pos token.Position) *ast.CreateWorkloadQuer
37583758
p.nextToken()
37593759
}
37603760

3761+
// Check for IF NOT EXISTS
3762+
if p.currentIs(token.IF) {
3763+
p.nextToken()
3764+
if p.currentIs(token.NOT) {
3765+
p.nextToken()
3766+
if p.currentIs(token.EXISTS) {
3767+
p.nextToken()
3768+
}
3769+
}
3770+
}
3771+
37613772
// Get workload name
37623773
if p.currentIs(token.IDENT) || p.current.Token.IsKeyword() {
37633774
query.Name = p.current.Value
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt3": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)