final class Operands
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Checks the number of columns of operands and builds the facts of truth-valued operators.

Rule: MYSQL-OPERAND-COLUMNS-001. A single value has one column; a row constructor or a subquery of several columns has its width; the width of a value whose type is not known is not decided and is not checked. An operator that takes single values reports a row operand; a comparison, an IN test and BETWEEN report operands of different widths. The truth value of a comparison, a logical operator or a predicate is an integer (Item_bool_func, a BIGINT of display width 1). Shared rule: every family that derives an operand position taking one value (the arguments of built-in functions, assigned values) checks the operand's fact with single(), and every family that compares rows uses comparable(), so the diagnostic ER_OPERAND_COLUMNS has one source. Terminates: no recursion. Source: https://dev.mysql.com/doc/refman/8.4/en/row-subqueries.html, https://dev.mysql.com/doc/refman/8.4/en/comparison-operators.html. Status: Implemented.

Methods§

public function single(ScalarFact $fact, Derivation $derivation): ScalarFact

Reports a row at a position that takes a single value; answers the fact, or for a row a value without type that names the report.

The value the position passes on (the result of @v := (1, 2)) is not a row any more, so an enclosing position does not report the same operand again.

Parameters

$factScalarFact
$derivationDerivation

Returns

Test cases 2
Called from 47
Calls 5
public function truth(Nullability $nullability): ScalarFact

Answers the facts of a truth value: an integer with the given NULL fact.

Parameters

$nullabilityNullability

Returns

Test cases 1
Called from 15
Calls 4

Test cases 5§

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

Dedicated tests 5

Relations§

Instantiated in 42
Method calls 67