classShowRows
final class ShowRows
The columns of the rows SHOW and EXPLAIN return.
Rule: MYSQL-SHOW-ROWS-001. The manual fixes the names and the order of the columns of each SHOW and EXPLAIN form; the server fixes their types and whether they can be NULL in the result metadata it sends, which differs between releases. The tables (Columns/*Reports) hold, for each layout and release, the names and those facts as the servers of the shipped releases report them. A type is stated by its kind: the server computes the length of several columns from the session (the character set of the connection, the longest value), so lengths are not part of the facts. Codes: v VARCHAR, c CHAR, t TEXT, m MEDIUMTEXT, l LONGTEXT, b BIGINT, B BIGINT UNSIGNED, i INT, I INT UNSIGNED, d DECIMAL, f DOUBLE, F DOUBLE UNSIGNED, D DATETIME, T TIMESTAMP, n NULL only (a column that is always NULL). Precision: every column is a known type, or NULL only. Terminates: a fixed table. Source: https://dev.mysql.com/doc/refman/8.4/en/show.html and the pages of each SHOW statement, https://dev.mysql.com/doc/refman/8.4/en/explain-output.html, and the result metadata of the shipped server releases. Status: Implemented.
Methods§
public function columns(Report $report, GrammarRelease $release): list<array{string, string}>Answers the names and codes of the columns of a layout in a release.
Parameters
$report | Report | |
$release | GrammarRelease |
Returns
list<array{string, string}>Test cases 2
Called from 1
Calls 9
- class-const SchemaReports::ROWS() line 71
- class-const ServerReports::ROWS() line 71
- class-const ReplicationReports::ROWS() line 71
- class-const ExplainReports::ROWS() line 71
- function-call
in_arrayline 74 - function-call
explodeline 74 - static-call Check::invariant() line 78
- function-call
strrposline 81 - function-call
substrline 82
public function slots(list<array{string, string}> $columns): list<OutputSlot>Answers the output slots of columns given by names and codes.
Parameters
$columns | list<array{string, string}> |
Returns
list<OutputSlot>Test cases 1
Called from 2
Calls 7
- function-call
str_ends_withline 98 - new OutputSlot line 99
- new Name line 99
- method-call ShowRows::type() line 99
- function-call
rtrimline 99 - class-const Nullability::Nullable() line 99
- class-const Nullability::NotNull() line 99
public function type(string $code): TypeFactAnswers the type of a code.
Parameters
$code | string |
Returns
Throws
InvariantViolation When the code is none of the codes of the tablesTest cases 1
Called from 1
Calls 14
- class-const ShowRows::CHARACTERS() line 112
- new Known line 113
- new Character line 113
- class-const ShowRows::INTEGERS() line 115
- new Integral line 118
- class-const NumericModifier::Unsigned() line 118
- new Decimal line 122
- new Floating line 123
- class-const FloatingKind::Double() line 123
- new Temporal line 125
- class-const TemporalKind::DateTime() line 125
- class-const TemporalKind::Timestamp() line 126
- new NullOnly line 127
- new InvariantViolation line 128
Private surface 2§
Implementation details, listed for orientation only.
private const CHARACTERS = ['v' => \SqlSemantics\Platform\MySql\Statement\Type\Kind\CharacterKind::VarChar…private const INTEGERS = ['b' => [\SqlSemantics\Platform\MySql\Statement\Type\Kind\IntegralKind::BigInt,…Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 2
Method calls 3
- method-call SqlSemantics\Platform\MySql\Rules\Server\AdminRows::record() packages/sql-semantics-mysql/src/Rules/Server/AdminRows.php:76
- method-call SqlSemantics\Platform\MySql\Rules\Utility\ShowFacts::shape() packages/sql-semantics-mysql/src/Rules/Utility/ShowFacts.php:83
- method-call SqlSemantics\Platform\MySql\Rules\Utility\ShowFacts::shape() packages/sql-semantics-mysql/src/Rules/Utility/ShowFacts.php:88