classInsertedColumn
final class InsertedColumn
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.The value an INSERT would have inserted into a column: VALUES(col) in ON DUPLICATE KEY UPDATE (Item_insert_value).
The function is deprecated from MySQL 8.0.20 in favour of a row alias.
Rule: MYSQL-INSERTED-COLUMN-001. Facts: the type of the column; the value is NULL outside ON DUPLICATE KEY UPDATE, so it can always be NULL. Terminates: the column is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/miscellaneous-functions.html#function_values. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE VALUES(a)');
$query->facts->scalar($query->statement->where)->nullability // => \SqlSemantics\Platform\MySql\Model\Statement\Type\Nullability::NullableProperties§
public ColumnUse $columnMethods§
public function __construct(public ColumnUse $column)Parameters
$column | ColumnUse | The column whose inserted value is read |
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the column; the value has its type and can be NULL.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 3
- new ScalarFact line 48
- method-call Derivation::scalar() line 48
- class-const Nullability::Nullable() line 48
public function render(Output $out): voidWrites VALUES and the column in parentheses.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 56
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.