classViewFacts
final class ViewFacts
Derives the query of a view definition and the declaration it stands for.
Rule: MYSQL-VIEW-FACTS-001. The query is derived as an independent query. The view declares the columns of MYSQL-TABLE-DECLARATION-001, named by its column list or, without one, by MYSQL-VIEW-COLUMNS-001; without a column list an alias that is no valid column name is reported (ER_WRONG_COLUMN_NAME, MYSQL-COLUMN-NAME-001). A column list of another length than the query result (ER_VIEW_WRONG_LIST) and a repeated column name (ER_DUP_FIELDNAME) are diagnostics. Terminates: one pass over the output fields. Source: https://dev.mysql.com/doc/refman/8.4/en/create-view.html. Status: Implemented.
Methods§
public function derive(ViewDefinition $definition, Derivation $derivation): TableDerives the query and answers the declaration of the view, reporting its problems.
Parameters
$definition | ViewDefinition | |
$derivation | Derivation |
Returns
Test cases 1
Called from 2
Calls 15
- method-call Derivation::query() line 35
- method-call Derivation::environment() line 35
- function-call
countline 36 - method-call Derivation::report() line 37
- new ViewColumnCount line 37
- new TableDeclaration line 39
- method-call ViewColumns::names() line 40
- new ViewColumns line 40
- method-call TableDeclaration::settled() line 40
- method-call TableDeclaration::view() line 41
- method-call ColumnNameRule::valid() line 44
- new ColumnNameRule line 44
- new IncorrectColumnName line 45
- method-call TableProblems::duplicates() line 49
- new TableProblems line 49
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.