classGroupedRow
final class GroupedRow
implements Relation
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.
The entry of a HAVING environment that hands the select list and the GROUP BY columns to the names written there.
Rule: MYSQL-HAVING-REFERENCE-001 (see ResultReferences). The entry travels as a visible occurrence with neither alias nor name and without any column, so no column lookup, qualifier or star can reach it; only HavingScope and ResultReferences recognise it, by its class. It is a working value of one derivation and never part of a statement. Source: https://dev.mysql.com/doc/refman/8.4/en/select.html. Status: Implemented.
Properties§
public list<Field> $groupingpublic bool $groupedpublic list<ConditionalColumn> $undecided = []Methods§
public function __construct(
public list<Field|OpenStar> $selected,
public list<Field> $grouping,
public bool $grouped,
public list<ConditionalColumn> $undecided = [],
)Parameters
$selected | list<Field|OpenStar> | The output fields of the select list, in order |
$grouping | list<Field> | The GROUP BY items that are columns, each with the resolution of its column at the HAVING position |
$grouped | bool | Whether the query block groups, aggregates or is DISTINCT |
$undecided | list<ConditionalColumn> | The GROUP BY items and select list items that are columns of an incompletely known occurrence |
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactAnswers the row without columns the entry contributes.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Test cases 1
Calls 2
- new RelationFact line 46
- new RowShape line 46
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 6
ColumnResolverTest::testUnlistedAnswersTheOccurrencesThatMayGiveAHavingPositionTheNamecallsHavingScopeTest::testEnterAddsTheGroupedRowAsAnOccurrenceWithoutColumnscallsHavingScopeTest::testLeaveLetsTheArgumentsOfASetFunctionSeeTheColumnscallsHavingScopeTest::testRowAnswersTheGroupedRowOfAHavingEnvironmentOnlycallsResultReferencesTest::testDeeperCountsTheQueriesBetweenTheUseAndTheColumncallsResultReferencesTest::testUnnamedStopsAtTheItemTheNameNamescalls
Relations§
Instantiated in 1
Type checks 2
Type declarations 7
- type SqlSemantics\Platform\MySql\Rules\ColumnResolver packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:169
- type SqlSemantics\Platform\MySql\Rules\Query\Having\HavingScope packages/sql-semantics-mysql/src/Rules/Query/Having/HavingScope.php:44
- type SqlSemantics\Platform\MySql\Rules\Query\Having\HavingScope packages/sql-semantics-mysql/src/Rules/Query/Having/HavingScope.php:129
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:54
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:62
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:89
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:136