final class StorageOptions
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Checks, derives and writes the option list of a tablespace, undo tablespace or log file group statement.

Rule: MYSQL-STORAGE-OPTIONS-001. A statement accepts the options its grammar rules list in some release (the constants of this class); the options are kept and written in order, separated by spaces (the commas between them are optional). While it parses, the server rejects a second NODEGROUP (unless the first is the undefined group 65535), COMMENT, ENGINE or FILE_BLOCK_SIZE (unless the first is 0) with ER_FILEGROUP_OPTION_ONLY_ONCE, and in MySQL 5.x a NO_WAIT while NO_WAIT is in effect; a size word other than digits with one K, M or G multiplier with ER_WRONG_SIZE_NUMBER; a number of 2^31 or more before the multiplier with ER_SIZE_OVERFLOW_ERROR; and a decimal or floating size or node group with ER_ONLY_INTEGERS_ALLOWED. Each is a diagnostic. Terminates: one pass over the options. Source: https://dev.mysql.com/doc/refman/8.4/en/create-tablespace.html, https://dev.mysql.com/doc/refman/8.4/en/create-logfile-group.html. Status: Implemented.

Constants§

public const TABLESPACE = ['INITIAL_SIZE', 'AUTOEXTEND_SIZE', 'MAX_SIZE', 'EXTENT_SIZE', 'NODEGROUP', 'EN…

The options of CREATE TABLESPACE.

public const ALTER_TABLESPACE = ['INITIAL_SIZE', 'AUTOEXTEND_SIZE', 'MAX_SIZE', 'ENGINE', 'WAIT', 'ENCRYPTION',…

The options of ALTER TABLESPACE.

public const CHANGE_DATAFILE = ['INITIAL_SIZE', 'AUTOEXTEND_SIZE', 'MAX_SIZE']

The options of ALTER TABLESPACE … CHANGE DATAFILE (MySQL 5.x).

public const UNDO_TABLESPACE = ['ENGINE']

The options of the undo tablespace statements.

public const LOGFILE_GROUP = ['INITIAL_SIZE', 'UNDO_BUFFER_SIZE', 'REDO_BUFFER_SIZE', 'NODEGROUP', 'ENGINE',…

The options of CREATE LOGFILE GROUP.

public const ALTER_LOGFILE_GROUP = ['INITIAL_SIZE', 'ENGINE', 'WAIT']

The options of ALTER LOGFILE GROUP.

public const DROP = ['ENGINE', 'WAIT']

The options of DROP TABLESPACE and DROP LOGFILE GROUP.

Methods§

public function checked(
    list<StorageOption> $options,
    list<string> $accepted,
    int $minimum = 0,
): list<StorageOption>

Checks an option list against the options a statement accepts.

Parameters

$optionslist<StorageOption>
$acceptedlist<string>The keywords of the accepted options
$minimumintThe least number of options

Returns

Test cases 1
Called from 10
Calls 4
public function derive(Derivation $derivation, list<StorageOption> $options): void

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

Parameters

$derivationDerivation
$optionslist<StorageOption>
Called from 10
Calls 11
public function unset(StorageOption $option): bool

Tells whether an option leaves its setting at the server's "not set" value: node group 65535 or block size 0.

Parameters

Returns

bool
Test cases 1
Called from 1
Calls 4
public function size(Derivation $derivation, string $keyword, ByteSize $size): void

Reports a size the server rejects.

Parameters

$derivationDerivation
$keywordstring
$sizeByteSize
Called from 1
Calls 10
public function render(Output $out, list<StorageOption> $options): void

Writes the options in order, separated by spaces.

Parameters

$outOutput
$optionslist<StorageOption>
Called from 10
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private const ONCE = ['NODEGROUP' => true, 'COMMENT' => true, 'ENGINE' => true, 'FILE_BLOCK_SIZE' =>…

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 30
Method calls 30
Constant reads 11