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

START TRANSACTION [characteristic, …]: a request to start a transaction.

Mirrors SQLCOM_BEGIN with LEX::start_transaction_opt. Rule: MYSQL-START-TRANSACTION-001. The characteristics are kept in written order; the server merges them into a set, so a repeated one has no further effect. READ ONLY and READ WRITE together are a syntax error of the server and cannot be constructed. Without an access mode the transaction takes the session's access mode. The statement names no relation and has no facts. Source: https://dev.mysql.com/doc/refman/8.4/en/commit.html. Status: Implemented.

Starting a read-only transaction with a consistent snapshotdoctest
$start = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('start transaction with consistent snapshot, read only');
    [$start->toString(), $start->statement->characteristics[1]] // => ['START TRANSACTION WITH CONSISTENT SNAPSHOT, READ ONLY', \SqlSemantics\Platform\MySql\Statement\Server\Transaction\TransactionCharacteristic::ReadOnly]

Properties§

public list<TransactionCharacteristic> $characteristics

Methods§

public function __construct(list<TransactionCharacteristic> $characteristics = [])

Parameters

$characteristicslist<TransactionCharacteristic>The characteristics in written order

Throws

InvalidConstruction When READ ONLY and READ WRITE are both requested
Calls 6
public function deriveStatement(Derivation $derivation): void

Has nothing to derive: the request names no relation and no value.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 3

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type checks 1
Type declarations 1