classXid
final class Xid
implements Node
uses Snapshot
@visibility public.The identifier of an XA transaction: gtrid [, bqual [, formatID]].
Mirrors XID. The global transaction identifier and the branch qualifier are strings of at most 64 bytes each, written as quoted strings or as hexadecimal or bit literals; the format identifier is an unsigned number and defaults to 1. A longer part is a syntax error of the server and cannot be constructed; a format identifier above 2^63-1 is a syntax error from MySQL 5.7 on and is refused when a statement holding it is derived for such a release (MYSQL-SERVER-MAGNITUDE-001). Source: https://dev.mysql.com/doc/refman/8.4/en/xa-statements.html.
$xid = new \SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\Xid(new \SqlSemantics\Platform\MySql\Statement\Literal\Text('g'), new \SqlSemantics\Platform\MySql\Statement\Literal\Text('b'), new \SqlSemantics\Platform\MySql\Statement\Literal\Numeral('7'));
[$xid->transaction->value, $xid->branch?->value, $xid->format?->text] // => ['g', 'b', '7']Properties§
public Text $transactionpublic Text|null $branch = nullpublic Numeral|null $format = nullMethods§
public function __construct(
public Text $transaction,
public Text|null $branch = null,
public Numeral|null $format = null,
)Parameters
Throws
InvalidConstruction When a part is too long or the format is written without a branch qualifierCalls 3
- new Magnitudes line 45
- static-call Check::input() line 46
- method-call Magnitudes::bytes() line 46
public function render(Output $out): voidWrites the parts separated by commas.
Parameters
$out | Output |
Calls 2
- method-call Output::node() line 56
- method-call Output::symbol() line 58
Test cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 6
MagnitudesTest::testIdentifierRefusesAFormatTheReleaseRejectscallsXaCommitTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaEndTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaPrepareTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaRollbackTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaStartTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56calls
Relations§
Instantiated in 1
Type declarations 7
- type SqlSemantics\Platform\MySql\Lowering\Server\Transaction\XaRule packages/sql-semantics-mysql/src/Lowering/Server/Transaction/XaRule.php:157
- type SqlSemantics\Platform\MySql\Rules\Server\Magnitudes packages/sql-semantics-mysql/src/Rules/Server/Magnitudes.php:91
- type SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\XaCommit packages/sql-semantics-mysql/src/Statement/Server/Transaction/Xa/XaCommit.php:34
- type SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\XaEnd packages/sql-semantics-mysql/src/Statement/Server/Transaction/Xa/XaEnd.php:34
- type SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\XaPrepare packages/sql-semantics-mysql/src/Statement/Server/Transaction/Xa/XaPrepare.php:33
- type SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\XaRollback packages/sql-semantics-mysql/src/Statement/Server/Transaction/Xa/XaRollback.php:33
- type SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\XaStart packages/sql-semantics-mysql/src/Statement/Server/Transaction/Xa/XaStart.php:34