classReorganizePartition
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.
$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) // => 2Properties§
public list<PartitionDefinition> $definitionspublic bool $localpublic NamedPartitions|null $partitions = nullMethods§
public function __construct(
public bool $local,
public NamedPartitions|null $partitions = null,
list<PartitionDefinition> $definitions = [],
)Parameters
$local | bool | Whether NO_WRITE_TO_BINLOG or LOCAL is written |
$partitions | NamedPartitions|null | The partitions to reorganize, or null for none written |
$definitions | list<PartitionDefinition> | The new partitions in order; at least one exactly when partitions are named |
Calls 3
- static-call Check::listOf() line 45
- class-const PartitionDefinition::class() line 45
- static-call Check::input() line 46
public function deriveCommand(Derivation $derivation, Environment $scope): voidDerives the partition values as constants.
Parameters
$derivation | Derivation | |
$scope | Environment |
public function render(Output $out): voidWrites the action.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 64
- method-call Output::node() line 69
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ReorganizePartitionTestcalls
Relations§
Instantiated in 4
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::command() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:156
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:176
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::reorganizeRule() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:251
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::reorganizeRule() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:252