Skip to content

Commit 936ba6d

Browse files
committed
Add EXTERNAL resource pool support for ALTER WORKLOAD GROUP
Support USING EXTERNAL pool_name syntax where the external pool can appear first in the USING clause, enabling: - USING EXTERNAL p_ext (external pool only) - USING EXTERNAL p_ext, p_int (external first, then internal) - USING p_int, EXTERNAL p_ext (internal first, then external) Enables AlterWorkloadGroupStatementTests130 and Baselines130.
1 parent b1e2884 commit 936ba6d

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

parser/parse_ddl.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6562,15 +6562,29 @@ func (p *Parser) parseAlterWorkloadGroupStatement() (*ast.AlterWorkloadGroupStat
65626562
// Parse USING clause (resource pool reference)
65636563
if strings.ToUpper(p.curTok.Literal) == "USING" {
65646564
p.nextToken() // consume USING
6565-
stmt.PoolName = p.parseIdentifier()
65666565

6567-
// Check for EXTERNAL
6568-
if p.curTok.Type == TokenComma {
6569-
p.nextToken()
6570-
}
6566+
// Check if EXTERNAL comes first
65716567
if strings.ToUpper(p.curTok.Literal) == "EXTERNAL" {
65726568
p.nextToken() // consume EXTERNAL
65736569
stmt.ExternalPoolName = p.parseIdentifier()
6570+
6571+
// Check for comma and internal pool
6572+
if p.curTok.Type == TokenComma {
6573+
p.nextToken()
6574+
stmt.PoolName = p.parseIdentifier()
6575+
}
6576+
} else {
6577+
// Internal pool first
6578+
stmt.PoolName = p.parseIdentifier()
6579+
6580+
// Check for EXTERNAL
6581+
if p.curTok.Type == TokenComma {
6582+
p.nextToken()
6583+
}
6584+
if strings.ToUpper(p.curTok.Literal) == "EXTERNAL" {
6585+
p.nextToken() // consume EXTERNAL
6586+
stmt.ExternalPoolName = p.parseIdentifier()
6587+
}
65746588
}
65756589
}
65766590

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}

0 commit comments

Comments
 (0)