classRow
final class Row
implements Scalar
uses Snapshot
@visibility public.A row constructor: (expr, expr …) or ROW(expr, expr …) (Item_row).
The keyword ROW is optional and does not change the row, so it is not part of the structure; the row is written in parentheses.
Rule: MYSQL-ROW-001. Facts: a row of as many columns as elements; it can be NULL when an element can. A row may appear only where a comparison, IN or a row subquery takes it; elsewhere MYSQL-OPERAND-COLUMNS-001 reports it. Terminates: the elements are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/row-subqueries.html. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE ROW(a, b) = (1, 2)');
[count($query->statement->where->left->elements), $query->toString()] // => [2, 'SELECT a FROM t WHERE ROW(a, b) = (1, 2)']Properties§
public non-empty-list<Scalar> $elementspublic OptionalWords $keyword = OptionalWords::OmittedMethods§
public function __construct(
list<Scalar> $elements,
public OptionalWords $keyword = OptionalWords::Omitted,
)Parameters
$elements | list<Scalar> | The elements in order; at least two |
$keyword | OptionalWords | Whether the optional ROW keyword is written |
Calls 3
- class-const OptionalWords::Omitted() line 48
- static-call Check::listOf() line 50
- class-const Scalar::class() line 50
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives every element and the row.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 6
- class-const Nullability::NotNull() line 58
- method-call Derivation::scalar() line 60
- new ScalarFact line 63
- new Known line 63
- new Tuple line 63
- function-call
countline 63
public function render(Output $out): voidWrites the ROW keyword when it is written and the elements in parentheses.
Parameters
$out | Output |
Test cases 1
Calls 3
- class-const OptionalWords::Written() line 71
- method-call Output::keyword() line 72
- method-call Output::symbol() line 74
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.