classSubqueryRows
final class SubqueryRows
Derives the value of a subquery used as an expression and the NULL fact of a test against its rows.
Rule: MYSQL-SUBQUERY-ROWS-001. A subquery used as a value yields the value of its one column, or a row of its columns, and NULL when it returns no row; a subquery with an unexpandable star depends on the inputs it misses. A membership or quantified test is NULL when the operand or a column of the subquery can be NULL; a subquery whose columns are not known leaves that dependent. The width of the operand must equal the number of columns (MYSQL-OPERAND-COLUMNS-001). Terminates: no recursion. Source: https://dev.mysql.com/doc/refman/8.4/en/scalar-subqueries.html, https://dev.mysql.com/doc/refman/8.4/en/row-subqueries.html, https://dev.mysql.com/doc/refman/8.4/en/any-in-some-subqueries.html. Status: Implemented.
Methods§
public function value(QueryFact $query): ScalarFactAnswers the facts of a subquery used as a value.
Parameters
$query | QueryFact |
Returns
Test cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\Expression\SubqueryRows::test() packages/sql-semantics-mysql/src/Rules/Expression/SubqueryRows.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Subquery\ScalarSubquery::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/ScalarSubquery.php:50
public function test(ScalarFact $operand, QueryFact $query, Derivation $derivation): NullabilityAnswers the NULL fact of a test of an operand against the rows of a subquery, reporting a width mismatch.
Parameters
$operand | ScalarFact | |
$query | QueryFact | |
$derivation | Derivation |
Returns
Test cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Subquery\InQuery::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/InQuery.php:57
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Subquery\QuantifiedComparison::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/QuantifiedComparison.php:61
Calls 4
- class-const Nullability::Dependent() line 57
- new Operands line 59
- method-call Operands::comparable() line 60
- method-call SubqueryRows::value() line 60
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Statement\Expression\Subquery\InQuery::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/InQuery.php:57
- new SqlSemantics\Platform\MySql\Statement\Expression\Subquery\QuantifiedComparison::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/QuantifiedComparison.php:61
- new SqlSemantics\Platform\MySql\Statement\Expression\Subquery\ScalarSubquery::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/ScalarSubquery.php:50
Method calls 3
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Subquery\InQuery::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/InQuery.php:57
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Subquery\QuantifiedComparison::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/QuantifiedComparison.php:61
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Subquery\ScalarSubquery::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Subquery/ScalarSubquery.php:50