classExchangePartition
final class ExchangePartition
implements StandaloneCommand
uses Snapshot
Public API: explicitly declared with
@visibility public.EXCHANGE PARTITION p WITH TABLE t [WITH | WITHOUT VALIDATION]: a request to swap a partition with an unpartitioned table.
Mirrors PT_alter_table_exchange_partition. The other table resolves by MYSQL-CHANGE-TARGET-001 and its resolution is the relation fact of this node. The validation option exists from 5.7 on. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-management-exchange.html.
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t EXCHANGE PARTITION p0 WITH TABLE u WITHOUT VALIDATION');
[$alter->statement->commands[0]->table->name->value, $alter->statement->commands[0]->validation?->validate] // => ['u', false]Properties§
public Name $partitionpublic QualifiedName $tablepublic ValidationOption|null $validation = nullMethods§
public function __construct(
public Name $partition,
public QualifiedName $table,
public ValidationOption|null $validation = null,
)Parameters
$partition | Name | The partition |
$table | QualifiedName | The table to swap with |
$validation | ValidationOption|null | WITH or WITHOUT VALIDATION, when written |
Calls 1
- static-call Check::input() line 42
public function deriveCommand(Derivation $derivation, Environment $scope): voidRecords the resolution of the other table.
Parameters
$derivation | Derivation | |
$scope | Environment |
Calls 3
- method-call Derivation::target() line 50
- method-call Targets::target() line 50
- new Targets line 50
public function render(Output $out): voidWrites the action.
Parameters
$out | Output |
Calls 5
- method-call Output::keyword() line 58
- class-const NameUse::Label() line 58
- method-call Output::name() line 60
- class-const NameUse::Qualifier() line 60
- class-const NameUse::Relation() line 62
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExchangePartitionTestcalls