final class SelectFacts
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Derives the facts of a query block.

Rule: MYSQL-SELECT-FACTS-001. The FROM clause is derived in the enclosing environment (MYSQL-FROM-SCOPE-001). The select list sees the FROM tables and, beyond them, the enclosing queries; it does not see its own aliases. WHERE sees the FROM tables. GROUP BY, QUALIFY and ORDER BY also see the aliases of the select list (MYSQL-SORT-SCOPE-001); HAVING sees the GROUP BY columns and the select list first (MYSQL-HAVING-SCOPE-001). The named windows see the FROM tables. In a block that aggregates without GROUP BY (MYSQL-AGGREGATE-QUERY-001; HAVING alone filters rows like WHERE) or groups WITH ROLLUP, ROLLUP or CUBE, every column of the FROM tables read by the select list, HAVING, the windows, QUALIFY and ORDER BY can be NULL. LIMIT, PROCEDURE ANALYSE, INTO and the locking clauses follow MYSQL-TAIL-FACTS-001; a late ordering is derived like the ORDER BY and LIMIT of the block. A window name defined twice is reported, and so is a window name the block does not define (MYSQL-WINDOW-NAME-001). The output fields follow MYSQL-STAR-001. Terminates: every clause is a strict part of the block. Source: https://dev.mysql.com/doc/refman/8.4/en/select.html, https://dev.mysql.com/doc/refman/8.4/en/group-by-modifiers.html ("the super-aggregate rows ... NULL"). Status: Implemented.

Methods§

public function derive(Select $select, Derivation $derivation, Environment $outer): QueryFact
public function windows(Select $select, Derivation $derivation, Environment $environment): void

Derives the named windows and reports a name defined twice.

Parameters

$selectSelect
$derivationDerivation
$environmentEnvironment
Called from 1
Calls 3
public function aliases(
    Select $select,
    list<Field|OpenStar> $items,
    LanguageProfile $profile,
): list<Field>

Answers the output fields a name can refer to by their item name, in output order: aliased items and the items not named after a column.

The server finds an item of the select list by its name, alias or name given after its text alike, unless the item is a column reference, which is found as the column it reads.

Parameters

$selectSelect
$itemslist<Field|OpenStar>
$profileLanguageProfile

Returns

list<Field>
Test cases 1
Called from 1
Calls 3

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
Method calls 1