classCommit
final class Commit
implements Statement
uses Snapshot
@visibility public.COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]: a request to end the transaction and make its changes permanent.
Mirrors SQLCOM_COMMIT with LEX::tx_chain and LEX::tx_release. Rule: MYSQL-COMMIT-001. Each completion choice is true when written as AND CHAIN or RELEASE, false when written with NO, and null when absent: an absent choice takes the completion_type of the session, so an explicit NO is a request of its own. AND CHAIN together with RELEASE is a syntax error of the server and cannot be constructed. WORK is optional and not written. The statement names no relation and has no facts. Source: https://dev.mysql.com/doc/refman/8.4/en/commit.html. Status: Implemented.
$end = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('commit work and no chain release');
[$end->toString(), $end->statement->chain, $end->statement->release] // => ['COMMIT AND NO CHAIN RELEASE', false, true]Properties§
public bool|null $chain = nullpublic bool|null $release = nullMethods§
public function __construct(public bool|null $chain = null, public bool|null $release = null)Parameters
$chain | bool|null | Whether AND CHAIN (true) or AND NO CHAIN (false) is written; null when absent |
$release | bool|null | Whether RELEASE (true) or NO RELEASE (false) is written; null when absent |
Throws
InvalidConstruction When both AND CHAIN and RELEASE are requestedCalls 1
- static-call Check::input() line 43
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): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.