classValueCountMismatch
final class ValueCountMismatch
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A row of an INSERT or REPLACE with another number of values than the columns it writes.
The row number counts from 1 for a row of VALUES; a query source has no row number. Source: https://dev.mysql.com/doc/refman/8.4/en/insert.html, https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html (ER_WRONG_VALUE_COUNT_ON_ROW, ER_WRONG_VALUE_COUNT).
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('INSERT INTO t (a) VALUES (1), (2, 3)') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: Column count doesn't match value count at row 2Properties§
public int $expectedpublic int $actualpublic int|null $row = nullMethods§
public function __construct(
public int $expected,
public int $actual,
public int|null $row = null,
)Parameters
$expected | int | The number of columns written |
$actual | int | The number of values of the row |
$row | int|null | The row number counted from 1, or null for the rows of a query |
Calls 1
- static-call Check::input() line 34
public function message(): stringDescribes the problem in the words of the server.
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.