classSetFacts
final class SetFacts
Derives the facts of a set operation.
Rule: MYSQL-SET-FACTS-001. Both operands are derived in the enclosing environment, each its own query block; the output columns combine them by MYSQL-RESULT-SLOTS-001. In the query of a recursive common table expression (MYSQL-WITH-001) a right operand that refers to the table sees it with the columns of the left operand, all nullable, and those columns are the output, whose types the recursive part does not change. The operands of a leading union (MYSQL-LEADING-UNION-001) are derived the same way and combined for the operation that continues it; the form needs MySQL 5.6 or 5.7, and the own LIMIT of its last SELECT needs 5.6. Terminates: both operands are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/set-operations.html, https://dev.mysql.com/doc/refman/8.4/en/with.html. Status: Implemented.
Methods§
public function derive(
SetOperation $operation,
Derivation $derivation,
Environment $outer,
): QueryFactDerives both operands and answers the output.
Parameters
$operation | SetOperation | |
$derivation | Derivation | |
$outer | Environment |
Returns
Called from 1
Calls 1
- method-call SetFacts::operands() line 43
public function operands(
Query|LeadingUnion $leftQuery,
SetOperator $operator,
Query $rightQuery,
Derivation $derivation,
Environment $outer,
): QueryFactDerives the two operands of a set operator and answers the output.
Parameters
$leftQuery | Query|LeadingUnion | |
$operator | SetOperator | |
$rightQuery | Query | |
$derivation | Derivation | |
$outer | Environment |
Returns
Called from 3
- method-call SqlSemantics\Platform\MySql\Rules\Query\SetFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/SetFacts.php:43
- method-call SqlSemantics\Platform\MySql\Rules\Query\SetFacts::leading() packages/sql-semantics-mysql/src/Rules/Query/SetFacts.php:71
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\OrderedSetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/OrderedSetOperation.php:94
Calls 9
- method-call SetFacts::leading() line 51
- method-call Derivation::query() line 51
- new CommonTables line 52
- method-call CommonTables::pending() line 53
- method-call CommonTables::anchored() line 54
- new QueryFact line 55
- method-call ResultSlots::combine() line 55
- new ResultSlots line 55
- method-call CommonTables::nullable() line 57
public function leading(
LeadingUnion $leading,
Derivation $derivation,
Environment $outer,
): QueryFactDerives the operands of a leading union and answers the rows they combine to.
Parameters
$leading | LeadingUnion | |
$derivation | Derivation | |
$outer | Environment |
Returns
Throws
InvalidConstruction When the release does not read the formCalled from 1
Calls 6
- static-call Check::input() line 68
- function-call
in_arrayline 68 - class-const GrammarRelease::MySql5651() line 68
- class-const GrammarRelease::MySql5744() line 68
- method-call SetFacts::operands() line 71
- class-const SetOperator::Union() line 71
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SetFactsTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Statement\Query\Set\OrderedSetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/OrderedSetOperation.php:94
- new SqlSemantics\Platform\MySql\Statement\Query\Set\SetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/SetOperation.php:80
Method calls 2
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\OrderedSetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/OrderedSetOperation.php:94
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\SetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/SetOperation.php:80