final class QuantifiedComparison
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A comparison with every or any row of a subquery: x op ALL|ANY (SELECT …) (Item_allany_subselect).

It belongs to the bool_pri level like the plain comparisons and takes a bool_pri operand (MYSQL-PRECEDENCE-001).

Rule: MYSQL-QUANTIFIED-COMPARISON-001. Facts: 1, 0 or NULL, an integer; NULL fact by MYSQL-SUBQUERY-ROWS-001 (<=> with ALL or ANY is still NULL when no row decides). Terminates: the operand and the query are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/any-in-some-subqueries.html, https://dev.mysql.com/doc/refman/8.4/en/all-subqueries.html. Status: Implemented.

Comparing with every rowdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a >= ALL (SELECT 1)');
    [$query->statement->where->operator->value, $query->statement->where->quantifier->value] // => ['>=', 'ALL']

Properties§

public Scalar $operand
public Quantifier $quantifier
public Query $query

Methods§

public function __construct(
    public Scalar $operand,
    public ComparisonOperator $operator,
    public Quantifier $quantifier,
    public Query $query,
)

Parameters

$operandScalarThe compared expression
$operatorComparisonOperatorThe comparison operator
$quantifierQuantifierWhether every row or any row must satisfy the comparison
$queryQueryThe query whose rows are compared with
Calls 4
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand and the query and the NULL fact of the comparison.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the operand, the operator, the quantifier and the query in parentheses.

Parameters

$outOutput
Calls 1

Test cases 3§

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

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 2
Type checks 1