classParseGeneratedColumn
final class ParseGeneratedColumn
implements Statement
uses Snapshot
@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.
$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 // => trueProperties§
public Scalar $expressionMethods§
public function __construct(public Scalar $expression)Parameters
$expression | Scalar | The generated column expression |
public function deriveStatement(Derivation $derivation): voidDerives the expression at a position that sees no relation.
Parameters
$derivation | Derivation |
Calls 2
- method-call Derivation::scalar() line 45
- method-call Derivation::environment() line 45
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.