classPartitionRule
final class PartitionRule
Lowers the partitioning clause: its method, counts and subpartitioning.
Rule: MYSQL-PARTITION-CLAUSE-001. Scope: opt_create_partitioning, opt_partitioning, partitioning, partition_entry, partition, partition_clause, part_type_def, opt_linear, opt_key_algo, part_field_list, part_field_item_list, part_field_item, part_column_list, part_func, sub_part_func, part_func_expr, opt_num_parts, opt_sub_part, sub_part_field_list, sub_part_field_item, opt_num_subparts, opt_name_list, name_list. KEY, HASH, RANGE and LIST over an expression or over columns become the method classes of PT_part_type_def; the parenthesized function of 5.6 and 5.7 is the bit expression it encloses. Constructs: PartitionClause, Subpartitioning, KeyMethod, HashMethod, ExpressionMethod, ColumnsMethod, PartitionEntry. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-partitioning. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function partitioning(Node $clause): ?PartitionClauseLowers an optional or required partitioning clause; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::others() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:154
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::partitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:111
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::partitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:70
Calls 5
- method-call Lowering::form() line 108
- method-call PartitionRule::partitioning() line 111
- method-call PartitionRule::marked() line 113
- method-call PartitionRule::clause() line 114
- static-call ImplementationGap::production() line 116
public function marked(Form $form): PartitionClauseLowers the 5.6 partitioning production that holds the partitioning marker.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Form::node() line 127
- method-call PartitionRule::clause() line 129
public function entry(Node $entry): PartitionEntryLowers the statement that is only a partitioning clause: a node of partition_entry.
Parameters
$entry | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 139
- static-call ImplementationGap::production() line 141
- new PartitionEntry line 144
- method-call PartitionRule::clause() line 144
public function clause(Node $clause): PartitionClauseLowers the method, counts, subpartitioning and definitions: a node of partition or partition_clause.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::partitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:114
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::partitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:115
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::marked() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:129
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::entry() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:144
Calls 9
- method-call Lowering::form() line 154
- class-const PartitionRule::CLAUSES() line 155
- static-call ImplementationGap::production() line 155
- new PartitionClause line 157
- method-call PartitionRule::method() line 158
- method-call PartitionRule::count() line 159
- method-call PartitionRule::subpartitioning() line 160
- method-call DefinitionRule::definitions() line 161
- new DefinitionRule line 161
public function method(Form $form): PartitionMethodLowers a method production of part_type_def or opt_sub_part.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::clause() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:158
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::subpartitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:196
Calls 14
- class-const PartitionRule::METHODS() line 172
- static-call ImplementationGap::production() line 172
- method-call PartitionRule::linear() line 173
- method-call Form::node() line 173
- new KeyMethod line 176
- method-call PartitionRule::algorithm() line 176
- method-call PartitionRule::columns() line 176
- new HashMethod line 177
- method-call PartitionRule::expression() line 177
- new ExpressionMethod line 178
- static-call PartitionKind::from() line 178
- new ColumnsMethod line 179
- class-const PartitionKind::Range() line 179
- class-const PartitionKind::List() line 180
public function subpartitioning(Node $clause): ?SubpartitioningLowers the subpartitioning: a node of opt_sub_part; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call Lowering::form() line 191
- new Subpartitioning line 196
- method-call PartitionRule::method() line 196
- method-call PartitionRule::count() line 196
- function-call
countline 196
public function linear(Node $linear): boolLowers LINEAR: a node of opt_linear.
Parameters
$linear | Node |
Returns
boolThrows
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Lowering::form() line 206
- static-call ImplementationGap::production() line 211
Lowers the ALGORITHM of a key method: a node of opt_key_algo; an absent option is null.
Parameters
$algorithm | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Lowering::form() line 222
- static-call ImplementationGap::production() line 227
Lowers a PARTITIONS or SUBPARTITIONS count: a node of opt_num_parts or opt_num_subparts; no count is null.
Parameters
$count | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::clause() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:159
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::subpartitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:196
Calls 2
- method-call Lowering::form() line 238
- static-call ImplementationGap::production() line 243
Lowers a partitioning function: a node of part_func, sub_part_func, part_func_expr or bit_expr.
Parameters
$function | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:177
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:178
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::expression() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:261
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::remembered() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:277
Calls 4
- method-call Lowering::form() line 257
- method-call PartitionRule::remembered() line 260
- method-call PartitionRule::expression() line 261
- static-call ImplementationGap::production() line 263
Lowers the 5.6 partitioning function that the source position markers enclose.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Form::node() line 274
- method-call PartitionRule::expression() line 277
Lowers a list of partitioning column names; an absent list is empty.
Parameters
$list | Node |
Returns
list<Name>Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:176
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:179
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:180
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::columns() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:294
Calls 10
- method-call Lowering::form() line 288
- class-const PartitionRule::COLUMN_LISTS() line 289
- method-call PartitionRule::columns() line 294
- function-call
countline 294 - function-call
array_key_existsline 296 - class-const PartitionRule::COLUMN_ITEMS() line 296
- static-call ImplementationGap::production() line 297
- method-call Lists::elements() line 300
- new Lists line 300
- method-call PartitionRule::column() line 302
Lowers one name of a partitioning column list: a node of ident, part_field_item or sub_part_field_item.
Parameters
$item | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 319
- function-call
in_arrayline 320 - class-const PartitionRule::COLUMN_ITEMS() line 320
- static-call ImplementationGap::production() line 321
Private surface 5§
Implementation details, listed for orientation only.
private const METHODS = ['part_type_def: opt_linear KEY_SYM opt_key_algo ( part_field_list )' => ['key'…private const CLAUSES = ['partition: BY part_type_def opt_num_parts opt_sub_part part_defs' => [1, 2, 3…private const COLUMN_LISTS = ['part_field_list:' => false, 'part_field_list: part_field_item_list' => true, …private const COLUMN_ITEMS = ['part_field_item_list: part_field_item' => 'part_field_item: ident', 'part_fie…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
PartitionRuleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::others() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:154
- new SqlSemantics\Platform\MySql\Lowering\TableChange\StatementRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/StatementRule.php:93
- new SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::partitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:70
Method calls 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::others() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:154
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\StatementRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/StatementRule.php:93
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\TableChangeRules::partitioning() packages/sql-semantics-mysql/src/Lowering/TableChange/TableChangeRules.php:70