classStartTransaction
final class StartTransaction
implements Statement
uses Snapshot
@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.
$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> $characteristicsMethods§
public function __construct(list<TransactionCharacteristic> $characteristics = [])Parameters
$characteristics | list<TransactionCharacteristic> | The characteristics in written order |
Throws
InvalidConstruction When READ ONLY and READ WRITE are both requestedCalls 6
- static-call Check::listOf() line 46
- class-const TransactionCharacteristic::class() line 46
- static-call Check::input() line 47
- function-call
in_arrayline 48 - class-const TransactionCharacteristic::ReadOnly() line 48
- class-const TransactionCharacteristic::ReadWrite() line 48
public function deriveStatement(Derivation $derivation): voidHas nothing to derive: the request names no relation and no value.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 65
- method-call Output::symbol() line 68
- function-call
explodeline 70
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.