classModifierRule
final class ModifierRule
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
$lowering | Lowering | The lowering this rule belongs to |
public function option(Node $option): AlgorithmOption|LockOptionLowers an ALGORITHM or LOCK option: a node of alter_algorithm_option or alter_lock_option.
Parameters
$option | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ItemRule::simple() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ItemRule.php:137
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ModifierRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ModifierRule.php:121
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ModifierRule::modifier() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ModifierRule.php:157
Calls 6
- method-call Lowering::form() line 82
- class-const ModifierRule::OPTIONS() line 83
- static-call ImplementationGap::production() line 83
- method-call ModifierRule::value() line 85
- new LockOption line 87
- new AlgorithmOption line 87
Lowers the value of an option: a node of ident, alter_algorithm_option_value or alter_lock_option_value; DEFAULT is null.
Parameters
$value | Node |
Returns
?NameThrows
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Lowering::form() line 100
- static-call ImplementationGap::production() line 105
public function pair(Node $options): list<AlgorithmOption|LockOption>Lowers the ALGORITHM and LOCK options of CREATE INDEX or DROP INDEX in the order written.
Parameters
$options | Node |
Returns
list<AlgorithmOption|LockOption>Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\StatementRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/StatementRule.php:88
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::alterOptions() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:82
Calls 4
- method-call Lowering::form() line 117
- class-const ModifierRule::PAIRS() line 118
- static-call ImplementationGap::production() line 118
- method-call ModifierRule::option() line 121
public function modifiers(Node $list): list<AlterModifier>Lowers a comma-separated list of modifiers: a node of alter_commands_modifier_list.
Parameters
$list | Node |
Returns
list<AlterModifier>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call Lowering::form() line 135
- static-call ImplementationGap::production() line 137
- method-call Lists::items() line 140
- new Lists line 140
- method-call ModifierRule::modifier() line 141
public function modifier(Node $modifier): AlterModifierLowers one modifier: a node of alter_commands_modifier.
Parameters
$modifier | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::items() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:171
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ModifierRule::modifiers() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ModifierRule.php:141
Calls 4
- method-call Lowering::form() line 154
- method-call ModifierRule::option() line 157
- method-call ModifierRule::validation() line 158
- static-call ImplementationGap::production() line 159
public function validation(Node $validation): ?ValidationOptionLowers a validation option: a node of opt_validation, alter_opt_validation, opt_with_validation or with_validation; none is null.
Parameters
$validation | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ModifierRule::modifier() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ModifierRule.php:158
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ModifierRule::validation() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ModifierRule.php:173
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::exchange() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:275
Calls 6
- method-call Lowering::form() line 171
- method-call ModifierRule::validation() line 173
- function-call
array_key_existsline 175 - class-const ModifierRule::VALIDATIONS() line 175
- static-call ImplementationGap::production() line 176
- new ValidationOption line 180
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 $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ModifierRuleTestcalls
Relations§
Instantiated in 6
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::others() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:146
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::items() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:171
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ItemRule::simple() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ItemRule.php:137
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::exchange() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:275
- new SqlSemantics\Platform\MySql\Lowering\TableChange\StatementRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/StatementRule.php:88
- new SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::alterOptions() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:82
Method calls 6
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::others() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:146
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::items() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:171
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\ItemRule::simple() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/ItemRule.php:137
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::exchange() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:275
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\StatementRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/StatementRule.php:88
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::alterOptions() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:82