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

A primary key column declared with the NULL attribute, which MySQL 5.7 and later reject (ER_PRIMARY_CANT_HAVE_NULL); MySQL 5.6 makes the column NOT NULL silently.

Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-indexes-keys.

Reading the problemdoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE TABLE t (a INT PRIMARY KEY NULL)') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: All parts of a PRIMARY KEY must be NOT NULL; column a is declared NULL.

Properties§

public Name $column

Methods§

public function __construct(public Name $column)

Parameters

$columnNameThe column declared NULL
public function message(): string

Describes the problem in the words of the server.

Returns

string
Test cases 1

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1