final class Row
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @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.

Comparing two rowsdoctest
$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> $elements
public OptionalWords $keyword = OptionalWords::Omitted

Methods§

public function __construct(
    list<Scalar> $elements,
    public OptionalWords $keyword = OptionalWords::Omitted,
)

Parameters

$elementslist<Scalar>The elements in order; at least two
$keywordOptionalWordsWhether the optional ROW keyword is written
Calls 3
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives every element and the row.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 6
public function render(Output $out): void

Writes the ROW keyword when it is written and the elements in parentheses.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 6§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3
Other tests reaching this symbol 3

Relations§

Instantiated in 2