classChangeRule
final class ChangeRule
Lowers UPDATE and DELETE of every release.
Rule: MYSQL-CHANGE-LOWERING-001. Scope: update, delete, single_multi, table_wild_list, table_wild_one, delete_limit_clause (5.6); update_stmt, delete_stmt; opt_low_priority, opt_delete_options, opt_delete_option. An UPDATE is Update; a DELETE with one table after FROM is Delete; the two multiple-table spellings are MultipleDelete with their form. Clauses are lowered by the query family. Terminates: the parts are strict subtrees; option lists are flattened by MYSQL-DML-LIST-001. Source: https://dev.mysql.com/doc/refman/8.4/en/update.html, https://dev.mysql.com/doc/refman/8.4/en/delete.html, https://dev.mysql.com/doc/refman/5.6/en/delete.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a node of update or update_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 8
- class-const ChangeRule::UPDATES() line 87
- static-call ImplementationGap::production() line 87
- new Update line 90
- method-call Form::node() line 91
- method-call ChangeRule::lowPriority() line 92
- method-call ValueRule::assignments() line 95
- new ValueRule line 95
- method-call ChangeRule::limit() line 98
Lowers a node of delete_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 9
- class-const ChangeRule::SINGLE() line 110
- new WriteTarget line 113
- method-call Form::node() line 113
- class-const AliasMark::As() line 113
- new Delete line 115
- method-call ChangeRule::options() line 115
- class-const ChangeRule::MULTIPLE() line 117
- static-call ImplementationGap::production() line 117
- new MultipleDelete line 119
Lowers a node of delete (5.6).
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 11
- static-call ImplementationGap::production() line 137
- method-call ChangeRule::options() line 139
- method-call Form::node() line 139
- method-call Lowering::form() line 140
- new Delete line 144
- new WriteTarget line 147
- method-call ChangeRule::limit() line 150
- new MultipleDelete line 152
- method-call ChangeRule::wildTargets() line 152
- class-const MultipleDeleteForm::BeforeFrom() line 152
- class-const MultipleDeleteForm::Using() line 153
public function options(Node $list): list<DeleteOption>Lowers a node of opt_delete_options.
Parameters
$list | Node |
Returns
list<DeleteOption>Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ChangeRule::delete() packages/sql-semantics-mysql/src/Lowering/Dml/ChangeRule.php:115
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ChangeRule::delete() packages/sql-semantics-mysql/src/Lowering/Dml/ChangeRule.php:121
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ChangeRule::legacyDelete() packages/sql-semantics-mysql/src/Lowering/Dml/ChangeRule.php:139
Calls 5
- method-call ListRule::items() line 167
- new ListRule line 167
- method-call Lowering::form() line 168
- class-const ChangeRule::OPTIONS() line 169
- static-call ImplementationGap::production() line 169
public function lowPriority(Node $option): boolLowers a node of opt_low_priority.
Parameters
$option | Node |
Returns
boolThrows
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Lowering::form() line 182
- static-call ImplementationGap::production() line 187
Lowers a LIMIT clause: a node of delete_limit_clause (5.6) or opt_simple_limit; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
Calls 2
- method-call Lowering::form() line 198
- new RowLimit line 202
public function wildTargets(Node $list): list<QualifiedName>Lowers the tables to delete from of a node of table_wild_list (5.6).
Parameters
$list | Node |
Returns
list<QualifiedName>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call ListRule::items() line 216
- new ListRule line 216
- method-call Lowering::form() line 217
- new QualifiedName line 220
- static-call ImplementationGap::production() line 222
Private surface 5§
Implementation details, listed for orientation only.
private const UPDATES = ['update: UPDATE_SYM opt_low_priority opt_ignore join_table_list SET update_lis…private const SINGLE = ['delete_stmt: DELETE_SYM opt_delete_options FROM table_ident opt_use_partition…private const MULTIPLE = ['delete_stmt: DELETE_SYM opt_delete_options table_alias_ref_list FROM join_tab…private const OPTIONS = ['opt_delete_option: QUICK' => \SqlSemantics\Platform\MySql\Statement\Dml\Delet…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
ChangeRuleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::statement() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:52
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::statement() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:53
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::statement() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:54
Method calls 3
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::statement() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:52
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::statement() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:53
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::statement() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:54