final class TransactionRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql\Lowering\Server". Code outside that scope must not name this declaration.

Lowers the transaction statements: BEGIN, START TRANSACTION, COMMIT, ROLLBACK and the savepoint statements.

Rule: MYSQL-TRANSACTION-001. Scope: begin (5.6, 5.7), begin_stmt (8.0 and later), start, opt_start_transaction_option_list, start_transaction_option_list, start_transaction_option, commit, rollback, savepoint, release, opt_work, opt_chain, opt_release, opt_savepoint. WORK and the SAVEPOINT of ROLLBACK TO are optional words (ServerNoise). READ ONLY with READ WRITE in START TRANSACTION, and AND CHAIN with RELEASE in COMMIT or ROLLBACK, are syntax errors the server raises in the grammar actions (sql_yacc.yy start, commit, rollback) and are rejected as such. Constructs: Begin, StartTransaction, Commit, Rollback, RollbackToSavepoint, Savepoint, ReleaseSavepoint. Terminates: the option list is flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/commit.html, https://dev.mysql.com/doc/refman/8.4/en/savepoint.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function statement(Form $form): Statement

Lowers a transaction statement.

Parameters

$formForm

Returns

Throws

ImplementationGap When a production has no rule
AnalysisException When the statement requests choices that exclude each other
Called from 1
Calls 8
public function start(Node $options): StartTransaction

Lowers START TRANSACTION from its option list: a node of opt_start_transaction_option_list.

Parameters

$optionsNode

Throws

ImplementationGap When a production has no rule
AnalysisException When READ ONLY and READ WRITE are both written
Called from 1
Calls 10

Private surface 4§

Implementation details, listed for orientation only.

private const CHARACTERISTICS = ['start_transaction_option: WITH CONSISTENT_SYM SNAPSHOT_SYM' => \SqlSemantics\…
private const COMPLETIONS = ['opt_chain:' => null, 'opt_chain: AND_SYM NO_SYM CHAIN_SYM' => false, 'opt_cha…
private const WORDS = ['opt_work:' => true, 'opt_work: WORK_SYM' => true, 'opt_savepoint:' => true, '…
private Lowering $lowering

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
Method calls 1