classTablespaceCommand
final class TablespaceCommand
implements StandaloneCommand
uses Snapshot
Public API: explicitly declared with
@visibility public.DISCARD | IMPORT [PARTITION ALL | p, …] TABLESPACE: a request to detach or attach the tablespace files of a table or of partitions.
Mirrors PT_alter_table_discard_tablespace, …_import_tablespace, …_discard_partition_tablespace and …_import_partition_tablespace. Source: https://dev.mysql.com/doc/refman/8.4/en/innodb-table-import.html.
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t DISCARD TABLESPACE');
[$alter->statement->commands[0]->import, $alter->toString()] // => [false, 'ALTER TABLE t DISCARD TABLESPACE']Properties§
public bool $importpublic PartitionSelection|null $partitions = nullMethods§
public function __construct(
public bool $import,
public PartitionSelection|null $partitions = null,
)Parameters
$import | bool | Whether IMPORT (true) or DISCARD (false) is written |
$partitions | PartitionSelection|null | The partitions, or null for the whole table |
public function deriveCommand(Derivation $derivation, Environment $scope): voidDerives nothing: the action holds no expression.
Parameters
$derivation | Derivation | |
$scope | Environment |
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TablespaceCommandTestcalls