diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ecafed3..46ca5fd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -102,8 +102,8 @@ jobs: - name: Run tests ${{ matrix.test-args }} continue-on-error: true - run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }} - +# run: vendor/bin/phpunit -c core --color=always ${{ matrix.test-args }} + run: vendor/bin/phpunit -c core --color=always modules/contrib/mysqli/tests/src/Kernel/mysqli/TransactionTest.php # - uses: actions/upload-artifact@v3 # with: # name: test-results diff --git a/src/Driver/Database/mysqli/Connection.php b/src/Driver/Database/mysqli/Connection.php index 1c62269..1e37c0c 100644 --- a/src/Driver/Database/mysqli/Connection.php +++ b/src/Driver/Database/mysqli/Connection.php @@ -220,11 +220,4 @@ protected function driverTransactionManager(): TransactionManagerInterface { return new TransactionManager($this); } - /** - * {@inheritdoc} - */ - public function startTransaction($name = '') { - return $this->transactionManager()->push($name); - } - } diff --git a/src/Driver/Database/mysqli/TransactionManager.php b/src/Driver/Database/mysqli/TransactionManager.php index 64718d3..859e631 100644 --- a/src/Driver/Database/mysqli/TransactionManager.php +++ b/src/Driver/Database/mysqli/TransactionManager.php @@ -47,14 +47,24 @@ protected function releaseClientSavepoint(string $name): bool { * {@inheritdoc} */ protected function rollbackClientTransaction(): bool { - return $this->connection->getClientConnection()->rollback(); + $clientRollback = $this->connection->getClientConnection()->rollBack(); + $this->setConnectionTransactionState($clientRollback ? + ClientConnectionTransactionState::RolledBack : + ClientConnectionTransactionState::RollbackFailed + ); + return $clientRollback; } /** * {@inheritdoc} */ protected function commitClientTransaction(): bool { - return $this->connection->getClientConnection()->commit(); + $clientCommit = $this->connection->getClientConnection()->commit(); + $this->setConnectionTransactionState($clientCommit ? + ClientConnectionTransactionState::Committed : + ClientConnectionTransactionState::CommitFailed + ); + return $clientCommit; } }