classOperandColumns
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.
(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 $expectedpublic int $actualMethods§
public function __construct(public int $expected, public int $actual)Parameters
$expected | int | The number of columns the position takes |
$actual | int | The number of columns the operand has |
Calls 1
- static-call Check::input() line 34
public function message(): stringDescribes the problem as the server does, with the actual width.
Returns
stringTest cases 1
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.