Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
V
Browse files Browse the repository at this point in the history
  • Loading branch information
mondrake committed Aug 31, 2023
1 parent bb569b6 commit 100560a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Driver/Database/mysqli/TransactionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ protected function rollbackClientSavepoint(string $name): bool {
}
catch (\mysqli_sql_exception $e) {
// If the rollback failed, most likely the savepoint was not there
// because the transaction is no longer active. In this case
dump($e);
// because the transaction is no longer active. In this case we cleanup.
$this->resetStack();
$this->setConnectionTransactionState(ClientConnectionTransactionState::Voided);
$this->processPostTransactionCallbacks();
Expand Down
7 changes: 4 additions & 3 deletions tests/src/Kernel/mysqli/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testTransactionWithDdlStatement() {
unset($transaction2);
$transaction3 = $this->connection->startTransaction();
$this->insertRow('row');
$transaction3->rollBack();
// $transaction3->rollBack();
unset($transaction3);
unset($transaction);
$this->assertRowAbsent('row');
Expand Down Expand Up @@ -118,7 +118,8 @@ public function testConnectionDeprecations(): void {
*/
public function testStartTransactionWhenActive(): void {
$this->connection->getClientConnection()->begin_transaction();
$this->connection->startTransaction();
$this->connection->getClientConnection()->begin_transaction();
// $this->connection->startTransaction();
$this->assertFalse($this->connection->inTransaction());
}

Expand All @@ -130,7 +131,7 @@ public function testCommitTransactionWhenInactive(): void {
$this->assertTrue($this->connection->inTransaction());
$this->connection->getClientConnection()->commit();
$transaction = NULL;
$this->assertTrue($this->connection->inTransaction());
$this->assertFalse($this->connection->inTransaction());
}

}

0 comments on commit 100560a

Please sign in to comment.