classEvaluation
final class Evaluation
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.DO: evaluates expressions and returns no rows.
Rule: MYSQL-DO-001. The expressions are derived as a select list without input relations (MYSQL-PROJECTION-001), so a star is reported as a star without tables; MySQL 5.7 and later accept select items with aliases, MySQL 5.6 an expression list. The statement returns no rows. Terminates: one pass over the items. Source: https://dev.mysql.com/doc/refman/8.4/en/do.html. Status: Implemented.
$do = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('DO SLEEP(1), @a := 2');
[count($do->statement->items), $do->facts->output, $do->toString()] // => [2, null, 'DO SLEEP(1), @a := 2']Properties§
public list<SelectExpression|Star|TableWildcard> $itemsMethods§
public function __construct(list<SelectExpression|Star|TableWildcard> $items)Parameters
$items | list<SelectExpression|Star|TableWildcard> | The items; at least one |
Throws
InvalidConstruction When there is no item, or an item is of no select item classCalls 3
- static-call Check::listOf() line 53
- class-const Node::class() line 53
- static-call Check::input() line 54
public function deriveStatement(Derivation $derivation): voidDerives the items where no relation is visible; the statement returns no rows.
Parameters
$derivation | Derivation |
Calls 6
- method-call Projection::items() line 65
- new Projection line 65
- method-call Derivation::environment() line 65
- new JoinedInput line 65
- new RelationFact line 65
- new RowShape line 65
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Dml\InvocationRule::evaluation() packages/sql-semantics-mysql/src/Lowering/Dml/InvocationRule.php:56
- new SqlSemantics\Platform\MySql\Lowering\Dml\InvocationRule::evaluation() packages/sql-semantics-mysql/src/Lowering/Dml/InvocationRule.php:60
- new SqlSemantics\Platform\MySql\Lowering\Dml\InvocationRule::evaluation() packages/sql-semantics-mysql/src/Lowering/Dml/InvocationRule.php:62