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

Derives the rows a SHOW returns and the condition of its WHERE clause.

Rule: MYSQL-SHOW-FACTS-001. A SHOW that accepts LIKE or WHERE is the relation occurrence of its own result rows: its relation fact is the shape of MYSQL-SHOW-ROWS-001, and the WHERE condition is derived at a position whose only visible relation is that occurrence, so a column name resolves to a result column (MYSQL-COLUMN-LOOKUP-001) and an unknown one is a diagnostic. The output of the statement is the same shape. A column name the server computes from the current database, such as Tables_in_db, is known when the statement or the context names the database; otherwise the shape is open and depends on the session's current database. The operands of a LIMIT are derived at a position that sees no relation. Terminates: one pass over a fixed shape. Source: https://dev.mysql.com/doc/refman/8.4/en/extended-show.html, https://dev.mysql.com/doc/refman/8.4/en/show.html. Status: Implemented.

Methods§

public function derive(
    Derivation $derivation,
    Statement&Relation $show,
    ShowLike|ShowWhere|null $filter,
): void

Derives a SHOW that is the relation its filter sees, and records its rows as the output.

Parameters

$derivationDerivation
$showStatement&Relation
$filterShowLike|ShowWhere|null
Called from 14
Calls 7
public function rows(Derivation $derivation, Report $report): void

Records the rows of a layout as the output of a statement without filter.

Parameters

$derivationDerivation
$reportReport
Called from 30
Calls 3
public function fact(
    Derivation $derivation,
    Report $report,
    ?string $first = null,
): RelationFact

Answers the relation fact of a layout, with the name of its first column replaced when given.

Parameters

$derivationDerivation
$reportReport
$first?string
Called from 14
Calls 2
public function query(RowShape $shape, Comparison $names): QueryFact

Answers the output of a shape: its fields, or an undetermined projection when the shape is open.

Parameters

$shapeRowShape
$namesComparison

Returns

Test cases 1
Called from 10
Calls 4
public function database(Derivation $derivation, ?Name $written): ?string

Answers the database a statement reports on: the one it names, else the current database of the context, else null.

Parameters

$derivationDerivation
$written?Name

Returns

?string
Called from 1
Calls 2
public function currentDatabase(): SessionState

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3

Relations§

Instantiated in 61
Method calls 82