classTargetRule
final class TargetRule
Lowers the table lists of multiple-table DELETE and locking clauses, and the duplicate handling of statements that copy rows.
Rule: MYSQL-DML-TARGETS-001. Scope: table_alias_ref_list, table_alias_ref, opt_duplicate, duplicate. A table of the list is a table name or a correlation name with an optional database; the .* suffix names the same table (LeafNoise). REPLACE and IGNORE are DuplicateHandling cases. Terminates: lists are flattened by MYSQL-DML-LIST-001. Source: https://dev.mysql.com/doc/refman/8.4/en/delete.html, https://dev.mysql.com/doc/refman/8.4/en/load-data.html, https://dev.mysql.com/doc/refman/8.4/en/create-table-select.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function tables(Node $list): list<QualifiedName>Lowers the tables of a node of table_alias_ref_list.
Parameters
$list | Node |
Returns
list<QualifiedName>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call ListRule::items() line 53
- new ListRule line 53
- method-call Lowering::form() line 59
public function wildcards(Node $list): list<OptionalWords>Tells for each table of a node of table_alias_ref_list whether it is written with .* (opt_wild).
Parameters
$list | Node |
Returns
list<OptionalWords>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call ListRule::items() line 77
- new ListRule line 77
- method-call Lowering::form() line 83
- function-call
countline 87 - class-const OptionalWords::Written() line 88
- class-const OptionalWords::Omitted() line 88
public function duplicates(Node $duplicate): ?DuplicateHandlingLowers a node of opt_duplicate or duplicate; an absent keyword is null.
Parameters
$duplicate | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call Lowering::form() line 101
- class-const TargetRule::DUPLICATES() line 109
- static-call ImplementationGap::production() line 109
Private surface 2§
Implementation details, listed for orientation only.
private const DUPLICATES = ['opt_duplicate: REPLACE' => \SqlSemantics\Platform\MySql\Statement\Dml\Duplica…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
TargetRuleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::duplicateHandling() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:73
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::deleteTargets() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:98
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::wildcards() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:109
Method calls 3
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::duplicateHandling() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:73
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::deleteTargets() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:98
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::wildcards() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:109