final class CreateTablespace
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CREATE TABLESPACE name [ADD DATAFILE 'file'] [USE LOGFILE GROUP group] [option …]: a request to create a general tablespace.

Mirrors PT_create_tablespace (Sql_cmd_create_tablespace) and the CREATE_TABLESPACE command of st_alter_tablespace in MySQL 5.x. Rule: MYSQL-CREATE-TABLESPACE-001. MySQL 5.x requires the data file; MySQL 8.0 lets InnoDB name it. USE LOGFILE GROUP is for NDB. The options are checked, kept and written in order by MYSQL-STORAGE-OPTIONS-001. A tablespace is no relation, so the statement neither declares nor resolves one. Source: https://dev.mysql.com/doc/refman/8.4/en/create-tablespace.html. Status: Implemented.

Creating a tablespacedoctest
$statement = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("create tablespace ts add datafile 'ts.ibd' engine = InnoDB");
    [$statement->toString(), $statement->statement->datafile?->value] // => ["CREATE TABLESPACE ts ADD DATAFILE 'ts.ibd' ENGINE InnoDB", 'ts.ibd']

Properties§

public list<StorageOption> $options
public Name $name
public Text|null $datafile = null
public Name|null $logfileGroup = null

Methods§

public function __construct(
    public Name $name,
    public Text|null $datafile = null,
    public Name|null $logfileGroup = null,
    list<StorageOption> $options = [],
)

Parameters

$nameNameThe tablespace name
$datafileText|nullThe data file of ADD DATAFILE, when written
$logfileGroupName|nullThe log file group of USE LOGFILE GROUP, when written
$optionslist<StorageOption>The options in written order
Calls 3
public function deriveStatement(Derivation $derivation): void

Reports the options the server rejects while it parses the statement.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 4

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 2

Relations§

Instantiated in 2