final class CreateResourceGroup
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CREATE RESOURCE GROUP name TYPE = USER|SYSTEM [VCPU = …] [THREAD_PRIORITY = n] [ENABLE|DISABLE] (8.0+).

Mirrors PT_create_resource_group. Rule: MYSQL-RESOURCE-GROUP-001. A priority outside -20 to 0 for a system group or 0 to 19 for a user group is PriorityOutOfRange. The = signs are optional words. Source: https://dev.mysql.com/doc/refman/8.4/en/create-resource-group.html. Status: Implemented.

Creating a group bound to two CPUsdoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('create resource group batch type user vcpu 2-3 thread_priority 10 disable')->toString() // => 'CREATE RESOURCE GROUP batch TYPE = USER VCPU = 2 - 3 THREAD_PRIORITY = 10 DISABLE'

Properties§

public list<CpuRange> $cpus
public Name $name
public ThreadPriority|null $priority = null
public bool|null $enabled = null

Methods§

public function __construct(
    public Name $name,
    public ResourceGroupKind $kind,
    list<CpuRange> $cpus = [],
    public ThreadPriority|null $priority = null,
    public bool|null $enabled = null,
)

Parameters

$nameNameThe group name
$kindResourceGroupKindThe group type
$cpuslist<CpuRange>The CPUs of VCPU; none when the option is absent
$priorityThreadPriority|nullThe THREAD_PRIORITY, when written
$enabledbool|nullENABLE (true) or DISABLE (false), when written
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports a priority outside the range of the group's type.

Parameters

$derivationDerivation
Calls 6
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 1