final class ReorganizePartition
    implements StandaloneCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

REORGANIZE PARTITION [NO_WRITE_TO_BINLOG] [p, … INTO (definitions)]: a request to redistribute rows into new partitions.

Mirrors PT_alter_table_reorganize_partition (no partitions: rebuild every partition of a HASH or KEY table) and PT_alter_table_reorganize_partition_into. LOCAL and NO_WRITE_TO_BINLOG are synonyms. The partition values are constants. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-management-range-list.html.

Splitting a partitiondoctest
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t REORGANIZE PARTITION p0 INTO (PARTITION a VALUES LESS THAN (5), PARTITION b VALUES LESS THAN (10))');
    count($alter->statement->commands[0]->definitions) // => 2

Properties§

public list<PartitionDefinition> $definitions
public bool $local
public NamedPartitions|null $partitions = null

Methods§

public function __construct(
    public bool $local,
    public NamedPartitions|null $partitions = null,
    list<PartitionDefinition> $definitions = [],
)

Parameters

$localboolWhether NO_WRITE_TO_BINLOG or LOCAL is written
$partitionsNamedPartitions|nullThe partitions to reorganize, or null for none written
$definitionslist<PartitionDefinition>The new partitions in order; at least one exactly when partitions are named
Calls 3
public function deriveCommand(Derivation $derivation, Environment $scope): void

Derives the partition values as constants.

Parameters

$derivationDerivation
$scopeEnvironment
public function render(Output $out): void

Writes the action.

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 4
Type declarations 1