classTailFacts
final class TailFacts
Derives the clauses written after a query: LIMIT, INTO and the locking clauses.
Rule: MYSQL-TAIL-FACTS-001. The LIMIT operands and the INTO targets see no column of the query. An INTO variable list whose length differs from the number of columns of a query whose columns are all known is reported. A table named by FOR UPDATE|SHARE OF that names no table of the query block is reported; over a set operation the tables are not checked. Source: https://dev.mysql.com/doc/refman/8.4/en/select-into.html, https://dev.mysql.com/doc/refman/8.4/en/innodb-locking-reads.html ("ER_UNRESOLVED_TABLE_LOCK"). Status: Implemented.
Methods§
public function derive(
Derivation $derivation,
Environment $outer,
QueryFact $fact,
?IntoDestination $into,
list<LockingClause> $locking,
list<VisibleRelation>|null $visible,
): voidDerives the INTO targets and checks the locking clauses.
Parameters
$derivation | Derivation | |
$outer | Environment | |
$fact | QueryFact | |
$into | ?IntoDestination | |
$locking | list<LockingClause> | |
$visible | list<VisibleRelation>|null | The tables of the query block, or null over another query |
Test cases 1
Called from 2
Calls 10
- method-call Derivation::scalar() line 47
- new Environment line 47
- function-call
countline 49 - method-call Derivation::report() line 50
- new CountMismatch line 50
- class-const CountedList::IntoVariables() line 50
- method-call Projection::admits() line 60
- new Projection line 60
- new Misuse line 63
- class-const MisuseRule::UnknownLockedTable() line 63
public function limit(?Limit $limit, Derivation $derivation, Environment $outer): voidDerives the operands of a LIMIT clause, which see no column of their query.
Parameters
$limit | ?Limit | |
$derivation | Derivation | |
$outer | Environment |
Called from 5
- method-call SqlSemantics\Platform\MySql\Rules\Dml\ChangeFacts::clauses() packages/sql-semantics-mysql/src/Rules/Dml/ChangeFacts.php:163
- method-call SqlSemantics\Platform\MySql\Rules\Dml\HandlerFacts::read() packages/sql-semantics-mysql/src/Rules/Dml/HandlerFacts.php:46
- method-call SqlSemantics\Platform\MySql\Rules\Query\ExpressionFacts::ordering() packages/sql-semantics-mysql/src/Rules/Query/ExpressionFacts.php:58
- method-call SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:85
- method-call SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:86
Calls 2
- method-call Derivation::scalar() line 77
- new Environment line 77
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 7
- new SqlSemantics\Platform\MySql\Rules\Dml\ChangeFacts::clauses() packages/sql-semantics-mysql/src/Rules/Dml/ChangeFacts.php:163
- new SqlSemantics\Platform\MySql\Rules\Dml\HandlerFacts::read() packages/sql-semantics-mysql/src/Rules/Dml/HandlerFacts.php:46
- new SqlSemantics\Platform\MySql\Rules\Query\ExpressionFacts::ordering() packages/sql-semantics-mysql/src/Rules/Query/ExpressionFacts.php:58
- new SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:85
- new SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:86
- new SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:91
- new SqlSemantics\Platform\MySql\Statement\Query\QueryStatement::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/QueryStatement.php:81
Method calls 7
- method-call SqlSemantics\Platform\MySql\Rules\Dml\ChangeFacts::clauses() packages/sql-semantics-mysql/src/Rules/Dml/ChangeFacts.php:163
- method-call SqlSemantics\Platform\MySql\Rules\Dml\HandlerFacts::read() packages/sql-semantics-mysql/src/Rules/Dml/HandlerFacts.php:46
- method-call SqlSemantics\Platform\MySql\Rules\Query\ExpressionFacts::ordering() packages/sql-semantics-mysql/src/Rules/Query/ExpressionFacts.php:58
- method-call SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:85
- method-call SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:86
- method-call SqlSemantics\Platform\MySql\Rules\Query\SelectFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SelectFacts.php:91
- method-call SqlSemantics\Platform\MySql\Statement\Query\QueryStatement::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/QueryStatement.php:81