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

Lowers ALTER TABLE: the statement and the lists that hold its actions.

Rule: MYSQL-ALTER-STATEMENT-001. Scope: the ALTER TABLE alternatives of alter (5.6, 5.7), alter_table_stmt, alter_commands, alter_command_list, opt_alter_table_actions, standalone_alter_table_action, alter_table_partition_options, opt_alter_command_list, alter_list, remove_partitioning. The actions are flattened into one list in the order written; a run of table options written without commas is one action. Constructs: AlterTable, SetTableOptions, PartitionBy, RemovePartitioning. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function statement(Form $form): AlterTable

Lowers ALTER TABLE: a production of alter routed to this family, or a node of alter_table_stmt.

Parameters

$formForm

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4
public function others(Form $form): list<AlterCommand>

Lowers the action lists that are not a sequence of parts: the list spine, modifiers and partitioning.

Parameters

$formForm

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 9
public function items(Node $list): list<AlterCommand>

Lowers the items of the action list spine: actions, modifiers and runs of table options.

Parameters

$listNode

Returns

Throws

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

Private surface 4§

Implementation details, listed for orientation only.

private const PARTS = ['alter_commands:' => [], 'alter_command_list:' => [], 'opt_alter_command_list:…
private const LISTS = ['alter_list: alter_list_item' => true, 'alter_list: alter_list , alter_list_it…
private const REMOVALS = ['remove_partitioning: REMOVE_SYM PARTITIONING_SYM have_partitioning' => true, …
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 1
Method calls 1