final class ExplainConnection
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

EXPLAIN FOR CONNECTION: the plan of the statement another connection is running (MySQL 5.7 and later).

Rule: MYSQL-EXPLAIN-CONNECTION-001. The connection is a thread number as SHOW PROCESSLIST reports it; the statement it runs is not part of the request. The options and the rows of the report follow MYSQL-EXPLAIN-ROWS-001. Terminates: no nested statement. Source: https://dev.mysql.com/doc/refman/8.4/en/explain-for-connection.html. Status: Implemented.

Reading the connectiondoctest
$explain = (new \SqlSemantics\Platform\MySql\Semantics('mysql-5.7.44'))->analyze('EXPLAIN FORMAT = JSON FOR CONNECTION 42');
    [$explain->statement->connection->text, $explain->field(0)->name?->value, $explain->toString()] // => ['42', 'EXPLAIN', 'EXPLAIN FORMAT = `JSON` FOR CONNECTION 42']

Properties§

public Numeral $connection
public Name|null $format = null
public bool $analyze = false
public ExplainModifier|null $modifier = null
public UserVariable|null $into = null

Methods§

public function __construct(
    public Numeral $connection,
    public Name|null $format = null,
    public bool $analyze = false,
    public ExplainModifier|null $modifier = null,
    public UserVariable|null $into = null,
)

Parameters

$connectionNumeralThe connection identifier
$formatName|nullThe format name after FORMAT =
$analyzeboolWhether ANALYZE is written
$modifierExplainModifier|nullThe EXTENDED or PARTITIONS keyword of MySQL 5.7
$intoUserVariable|nullThe variable after INTO
Calls 1
public function deriveStatement(Derivation $derivation): void

Records the rows of the report.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes EXPLAIN, the options and the connection.

Parameters

$outOutput
Calls 2

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 2
Type checks 1