classStandaloneRule
final class StandaloneRule
Lowers the partition and tablespace operations of ALTER TABLE.
Rule: MYSQL-ALTER-STANDALONE-001. Scope: the partition and tablespace alternatives of alter_commands (5.6), standalone_alter_commands, add_partition_rule, add_part_extra, reorg_partition_rule, reorg_parts_rule, alt_part_name_list, alt_part_name_item, all_or_alt_part_name_list. LOCAL and NO_WRITE_TO_BINLOG are synonyms. The CHECK and REPAIR options are lowered by the server family. Constructs: TablespaceCommand, AddPartition, DropPartition, MaintainPartitions, CoalescePartition, ReorganizePartition, ExchangePartition, SecondaryLoad, AllPartitions, NamedPartitions. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table-partition-operations.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function claims(string $signature): boolTells whether a production of alter_commands or standalone_alter_commands is a partition or tablespace operation.
Parameters
$signature | string |
Returns
boolTest cases 1
Called from 1
Calls 5
- class-const StandaloneRule::TABLESPACES() line 124
- class-const StandaloneRule::MAINTENANCE() line 124
- class-const StandaloneRule::SINGLES() line 124
- class-const StandaloneRule::PAIRS() line 124
- class-const StandaloneRule::SECONDARY() line 125
public function command(Form $form): StandaloneCommandLowers a partition or tablespace operation.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 19
- class-const StandaloneRule::TABLESPACES() line 135
- new TablespaceCommand line 138
- method-call StandaloneRule::selection() line 138
- method-call Form::node() line 138
- class-const StandaloneRule::MAINTENANCE() line 140
- method-call StandaloneRule::maintain() line 141
- class-const StandaloneRule::SECONDARY() line 143
- new SecondaryLoad line 144
- class-const StandaloneRule::PAIRS() line 146
- method-call StandaloneRule::pair() line 147
- class-const StandaloneRule::SINGLES() line 149
- static-call ImplementationGap::production() line 149
- method-call StandaloneRule::addRule() line 153
- method-call StandaloneRule::reorganizeRule() line 154
- new AddPartition line 155
- method-call StandaloneRule::local() line 155
- new ReorganizePartition line 156
- new DropPartition line 157
- method-call StandaloneRule::names() line 157
public function pair(Form $form): StandaloneCommandLowers an operation whose operands are at two positions.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 11
- class-const StandaloneRule::PAIRS() line 169
- static-call ImplementationGap::production() line 169
- new DefinitionRule line 170
- new AddPartition line 173
- method-call StandaloneRule::local() line 173
- method-call Form::node() line 173
- method-call DefinitionRule::definitions() line 173
- new CoalescePartition line 175
- new ReorganizePartition line 176
- method-call StandaloneRule::names() line 176
- method-call StandaloneRule::exchange() line 177
public function maintain(Form $form): MaintainPartitionsLowers a maintenance operation on partitions.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- class-const StandaloneRule::MAINTENANCE() line 188
- class-const MaintenanceKind::Repair() line 192
- method-call Form::node() line 192
- new MaintainPartitions line 195
- method-call StandaloneRule::local() line 197
- method-call StandaloneRule::selection() line 198
public function local(Node $option): boolLowers NO_WRITE_TO_BINLOG or LOCAL: a node of opt_no_write_to_binlog.
Parameters
$option | Node |
Returns
boolThrows
ImplementationGap When a production has no ruleCalled from 10
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::command() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:155
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::command() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:156
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:173
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:174
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:175
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:176
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::maintain() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:197
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::maintain() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:200
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::addRule() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:225
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::reorganizeRule() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:247
public function addRule(Node $rule): AddPartitionLowers the 5.x ADD PARTITION: a node of add_partition_rule.
Parameters
$rule | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call Lowering::form() line 221
- static-call ImplementationGap::production() line 223
- method-call StandaloneRule::local() line 225
- new AddPartition line 229
- method-call DefinitionRule::definitions() line 230
- new DefinitionRule line 230
public function reorganizeRule(Node $rule): ReorganizePartitionLowers the 5.x REORGANIZE PARTITION: a node of reorg_partition_rule.
Parameters
$rule | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 7
- method-call Lowering::form() line 243
- static-call ImplementationGap::production() line 245
- method-call StandaloneRule::local() line 247
- new ReorganizePartition line 251
- method-call StandaloneRule::names() line 254
- method-call DefinitionRule::definitions() line 255
- new DefinitionRule line 255
public function exchange(Form $form, int $partition, int $table): ExchangePartitionLowers EXCHANGE PARTITION.
Parameters
$form | Form | |
$partition | int | |
$table | int |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call Form::node() line 268
- method-call StandaloneRule::item() line 269
- method-call ModifierRule::validation() line 275
- new ModifierRule line 275
- new ExchangePartition line 278
public function selection(Node $list): PartitionSelectionLowers the partitions an operation names: a node of all_or_alt_part_name_list.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::command() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:138
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::maintain() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:198
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::partitionNames() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:92
Calls 4
- method-call Lowering::form() line 288
- new AllPartitions line 291
- method-call StandaloneRule::names() line 292
- static-call ImplementationGap::production() line 293
public function names(Node $list): NamedPartitionsLowers a list of partition names: a node of alt_part_name_list or ident_string_list.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::command() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:157
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::pair() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:176
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::reorganizeRule() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:254
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::selection() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:292
Calls 6
- new NamedPartitions line 305
- method-call Lowering::form() line 307
- static-call ImplementationGap::production() line 309
- method-call Lists::items() line 312
- new Lists line 312
- method-call StandaloneRule::item() line 313
Answers the name node of one partition name: a node of alt_part_name_item.
Parameters
$item | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::exchange() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:269
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\StandaloneRule::names() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/StandaloneRule.php:313
Calls 2
- method-call Lowering::form() line 326
- static-call ImplementationGap::production() line 328
Private surface 6§
Implementation details, listed for orientation only.
private const TABLESPACES = ['alter_commands: DISCARD TABLESPACE' => [false, null], 'alter_commands: IMPORT…private const MAINTENANCE = ['alter_commands: REBUILD_SYM PARTITION_SYM opt_no_write_to_binlog all_or_alt_p…private const SINGLES = ['alter_commands: add_partition_rule' => ['addRule', 0], 'standalone_alter_comm…private const PAIRS = ['standalone_alter_commands: ADD PARTITION_SYM opt_no_write_to_binlog ( part_de…private const SECONDARY = ['standalone_alter_commands: SECONDARY_LOAD_SYM' => true, 'standalone_alter_com…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
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::commands() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:119
- new SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::partitionNames() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:92
Method calls 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::commands() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:120
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::commands() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:121
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::partitionNames() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:92