final class OperandColumns
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

An operand with a number of columns its position does not take (ER_OPERAND_COLUMNS, error 1241).

A single value is one column; a row constructor or a subquery of several columns is a row. The server rejects a row where a single value is required and rows of different widths in one comparison. Source: https://dev.mysql.com/doc/refman/8.4/en/row-subqueries.html, https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_operand_columns.

Reporting a row where a single value is requireddoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE (a, b) + 1') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: Operand should contain 1 column(s), not 2.

Properties§

public int $expected
public int $actual

Methods§

public function __construct(public int $expected, public int $actual)

Parameters

$expectedintThe number of columns the position takes
$actualintThe number of columns the operand has
Calls 1
public function message(): string

Describes the problem as the server does, with the actual width.

Returns

string
Test cases 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