final class DefaultRequest
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

The keyword DEFAULT used as a value: the default of the column it is assigned to.

Mirrors the server's Item_default_value without an argument. The value means something only where a statement assigns it to a column: a row of INSERT or REPLACE, an assignment of SET, ON DUPLICATE KEY UPDATE, UPDATE or LOAD DATA.

Rule: MYSQL-DML-DEFAULT-001. The statement that assigns the value derives it at a position whose environment holds exactly one field, the column it is assigned to; the value has the type and nullability of that column, because the default is stored as a value of the column. Anywhere else, such as a row of a VALUES statement, the server rejects DEFAULT and the fact is that diagnostic. Terminates: no child. Source: https://dev.mysql.com/doc/refman/8.4/en/insert.html, https://dev.mysql.com/doc/refman/8.4/en/values.html. Status: Implemented.

Reading the value DEFAULT of an INSERTdoctest
$insert = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('INSERT INTO t (a) VALUES (DEFAULT)');
    $insert->statement->rows[0]->values[0] instanceof \SqlSemantics\Platform\MySql\Statement\Dml\DefaultRequest // => true

Methods§

public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the type and nullability of the column the value is assigned to.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 7
public function render(Output $out): void

Writes the keyword.

Parameters

$outOutput
Calls 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
Type checks 2