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).

Reading a row with too many valuesdoctest
(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 2

Properties§

public int $expected
public int $actual
public int|null $row = null

Methods§

public function __construct(
    public int $expected,
    public int $actual,
    public int|null $row = null,
)

Parameters

$expectedintThe number of columns written
$actualintThe number of values of the row
$rowint|nullThe row number counted from 1, or null for the rows of a query
Calls 1
public function message(): string

Describes the problem in the words of the server.

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