diff options
-rw-r--r-- | includes/libs/rdbms/database/Database.php | 8 | ||||
-rw-r--r-- | includes/libs/rdbms/database/TransactionManager.php | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 17ff248f3a5d..951f763877a0 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -2386,7 +2386,7 @@ abstract class Database implements Stringable, IDatabaseForOwner, IMaintainableD if ( !$this->trxLevel() ) { $this->transactionManager->setTrxStatusToNone(); $this->transactionManager->clearPreEndCallbacks(); - if ( $this->transactionManager->trxLevel() <= TransactionManager::STATUS_TRX_ERROR ) { + if ( $this->transactionManager->trxLevel() === TransactionManager::STATUS_TRX_ERROR ) { $this->logger->info( "$fname: acknowledged server-side transaction loss on {db_server}", $this->getLogContext() @@ -2475,7 +2475,7 @@ abstract class Database implements Stringable, IDatabaseForOwner, IMaintainableD ); } - if ( $this->transactionManager->sessionStatus() <= TransactionManager::STATUS_SESS_ERROR ) { + if ( $this->transactionManager->sessionStatus() === TransactionManager::STATUS_SESS_ERROR ) { // If the session state was already lost due to either an unacknowledged session // state loss error (e.g. dropped connection) or an explicit connection close call, // then there is nothing to do here. Note that in such cases, even temporary tables @@ -2947,8 +2947,8 @@ abstract class Database implements Stringable, IDatabaseForOwner, IMaintainableD // spam and confusing replacement of an original DBError with one about unlock(). // Unlock query will fail anyway; avoid possibly triggering errors in rollback() if ( - $this->transactionManager->sessionStatus() <= TransactionManager::STATUS_SESS_ERROR || - $this->transactionManager->trxStatus() <= TransactionManager::STATUS_TRX_ERROR + $this->transactionManager->sessionStatus() === TransactionManager::STATUS_SESS_ERROR || + $this->transactionManager->trxStatus() === TransactionManager::STATUS_TRX_ERROR ) { return; } diff --git a/includes/libs/rdbms/database/TransactionManager.php b/includes/libs/rdbms/database/TransactionManager.php index 1022c46245ed..c3bfc2e1a24e 100644 --- a/includes/libs/rdbms/database/TransactionManager.php +++ b/includes/libs/rdbms/database/TransactionManager.php @@ -177,7 +177,7 @@ class TransactionManager { } public function assertTransactionStatus( IDatabase $db, $deprecationLogger, $fname ) { - if ( $this->trxStatus < self::STATUS_TRX_OK ) { + if ( $this->trxStatus === self::STATUS_TRX_ERROR ) { throw new DBTransactionStateError( $db, "Cannot execute query from $fname while transaction status is ERROR", @@ -211,7 +211,7 @@ class TransactionManager { * @param Throwable $trxError */ public function setTransactionError( Throwable $trxError ) { - if ( $this->trxStatus > self::STATUS_TRX_ERROR ) { + if ( $this->trxStatus !== self::STATUS_TRX_ERROR ) { $this->trxStatus = self::STATUS_TRX_ERROR; $this->trxStatusCause = $trxError; } |