final class ParseGeneratedColumn
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

The internal statement PARSE_GCOL_EXPR(expr) of MySQL 5.7, which the server uses to read a stored generated column expression.

Rule: MYSQL-PARSE-GCOL-EXPR-001. The grammar of 5.7 reaches it from SQL text because PARSE_GCOL_EXPR is a keyword of its lexer; the server only accepts it while it opens a table definition. Outside one, no table is visible: the expression is derived at a position that sees no relation, so a column name in it is a missing column. Source: sql/sql_yacc.yy and sql/table.cc (unpack_gcol_info) of MySQL 5.7, https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html. Status: Implemented.

Reading the expressiondoctest
$statement = (new \SqlSemantics\Platform\MySql\Semantics('mysql-5.7.44'))->analyze('PARSE_GCOL_EXPR(1 + 2)');
    $statement->statement instanceof \SqlSemantics\Platform\MySql\Statement\Table\ParseGeneratedColumn // => true

Properties§

public Scalar $expression

Methods§

public function __construct(public Scalar $expression)

Parameters

$expressionScalarThe generated column expression
public function deriveStatement(Derivation $derivation): void

Derives the expression at a position that sees no relation.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 1