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.

Discarding the tablespace of a tabledoctest
$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 $import
public PartitionSelection|null $partitions = null

Methods§

public function __construct(
    public bool $import,
    public PartitionSelection|null $partitions = null,
)

Parameters

$importboolWhether IMPORT (true) or DISCARD (false) is written
$partitionsPartitionSelection|nullThe partitions, or null for the whole table
public function deriveCommand(Derivation $derivation, Environment $scope): void

Derives nothing: the action holds no expression.

Parameters

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

Writes the action.

Parameters

$outOutput
Calls 1

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