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

Lowers the modifiers of ALTER TABLE and the ALGORITHM and LOCK options of CREATE INDEX and DROP INDEX.

Rule: MYSQL-ALTER-MODIFIER-001. Scope: alter_algorithm_option, alter_algorithm_option_value, alter_lock_option, alter_lock_option_value, opt_index_lock_algorithm, opt_index_lock_and_algorithm, alter_commands_modifier_list, alter_commands_modifier, opt_validation, alter_opt_validation, opt_with_validation, with_validation. The = is an optional word; the keyword DEFAULT is the absent name; the name of an algorithm or lock level is kept as written and checked when the statement is derived (MYSQL-ALTER-CHOICES-001). Constructs: AlgorithmOption, LockOption, ValidationOption. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-performance. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function value(Node $value): ?Name

Lowers the value of an option: a node of ident, alter_algorithm_option_value or alter_lock_option_value; DEFAULT is null.

Parameters

$valueNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 2
public function modifiers(Node $list): list<AlterModifier>

Lowers a comma-separated list of modifiers: a node of alter_commands_modifier_list.

Parameters

$listNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 5

Private surface 4§

Implementation details, listed for orientation only.

private const OPTIONS = ['alter_algorithm_option: ALGORITHM_SYM opt_equal DEFAULT' => [false, null], 'a…
private const PAIRS = ['opt_index_lock_algorithm:' => [], 'opt_index_lock_algorithm: alter_lock_optio…
private const VALIDATIONS = ['opt_validation:' => null, 'opt_with_validation:' => null, 'alter_opt_validati…
private Lowering $lowering

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 6
Method calls 6