@@ -3034,7 +3034,7 @@ func SetDirectPlacementOpt(placementSettings *model.PlacementSettings, placement
3034
3034
}
3035
3035
3036
3036
// SetDirectResourceGroupUnit tries to set the ResourceGroupSettings.
3037
- func SetDirectResourceGroupUnit (resourceGroupSettings * model.ResourceGroupSettings , typ ast.ResourceUnitType , stringVal string , uintVal uint64 ) error {
3037
+ func SetDirectResourceGroupUnit (resourceGroupSettings * model.ResourceGroupSettings , typ ast.ResourceUnitType , stringVal string , uintVal uint64 , boolValue bool ) error {
3038
3038
switch typ {
3039
3039
case ast .ResourceRRURate :
3040
3040
resourceGroupSettings .RRURate = uintVal
@@ -3046,6 +3046,13 @@ func SetDirectResourceGroupUnit(resourceGroupSettings *model.ResourceGroupSettin
3046
3046
resourceGroupSettings .IOReadBandwidth = stringVal
3047
3047
case ast .ResourceUnitIOWriteBandwidth :
3048
3048
resourceGroupSettings .IOWriteBandwidth = stringVal
3049
+ case ast .ResourceBurstableOpiton :
3050
+ limit := int64 (0 )
3051
+ if boolValue {
3052
+ // negative means no limit within burst setting.
3053
+ limit = - 1
3054
+ }
3055
+ resourceGroupSettings .BurstLimit = limit
3049
3056
default :
3050
3057
return errors .Trace (errors .New ("unknown resource unit type" ))
3051
3058
}
@@ -7612,7 +7619,7 @@ func (d *ddl) CreateResourceGroup(ctx sessionctx.Context, stmt *ast.CreateResour
7612
7619
groupName := stmt .ResourceGroupName
7613
7620
groupInfo .Name = groupName
7614
7621
for _ , opt := range stmt .ResourceGroupOptionList {
7615
- err := SetDirectResourceGroupUnit (groupInfo .ResourceGroupSettings , opt .Tp , opt .StrValue , opt .UintValue )
7622
+ err := SetDirectResourceGroupUnit (groupInfo .ResourceGroupSettings , opt .Tp , opt .StrValue , opt .UintValue , opt . BoolValue )
7616
7623
if err != nil {
7617
7624
return err
7618
7625
}
@@ -7695,7 +7702,7 @@ func (d *ddl) DropResourceGroup(ctx sessionctx.Context, stmt *ast.DropResourceGr
7695
7702
func buildResourceGroup (oldGroup * model.ResourceGroupInfo , options []* ast.ResourceGroupOption ) (* model.ResourceGroupInfo , error ) {
7696
7703
groupInfo := & model.ResourceGroupInfo {Name : oldGroup .Name , ID : oldGroup .ID , ResourceGroupSettings : & model.ResourceGroupSettings {}}
7697
7704
for _ , opt := range options {
7698
- err := SetDirectResourceGroupUnit (groupInfo .ResourceGroupSettings , opt .Tp , opt .StrValue , opt .UintValue )
7705
+ err := SetDirectResourceGroupUnit (groupInfo .ResourceGroupSettings , opt .Tp , opt .StrValue , opt .UintValue , opt . BoolValue )
7699
7706
if err != nil {
7700
7707
return nil , err
7701
7708
}
0 commit comments