This commit is contained in:
shimon committed 2025-10-20 13:40:14 +03:00
1 parent 622cd6b86e
commit 62d03aebb6
2 files changed
+3 -7

No files matched your search

+3 -3
View File
@@ -101,7 +101,7 @@ class Client
* Commands that don't support readConcern
*/
private array $readConcernNotSupporteedCommands = [
self::COMMAND_GET_MORE,
self::COMMAND_GET_MORE,
self::COMMAND_KILL_CURSORS
];
@@ -330,7 +330,7 @@ class Client
// MongoDB will reject commands with readConcern that have txnNumber but not startTransaction
// Or if the command is in the readConcernNotSupporteedCommands array
if (((isset($command['txnNumber']) && !isset($command['startTransaction']) && isset($command['readConcern']))
||
||
in_array(array_keys($command)[0] ?? '', $this->readConcernNotSupporteedCommands))) {
unset($command['readConcern']);
}
@@ -2062,4 +2062,4 @@ class Client
{
$this->close();
}
}
}
-4
View File
@@ -162,7 +162,6 @@ class TransactionTest extends TestCase
// Verify final state
$finalState = $client->getSessionState($session);
$this->assertEquals('committed', $finalState['state']);
} finally {
$client->endSessions([$session]);
}
@@ -202,7 +201,6 @@ class TransactionTest extends TestCase
// Verify document was not inserted (transaction rolled back)
$found = $client->find('test_collection', ['name' => 'abort_test']);
$this->assertEmpty($found->cursor->firstBatch);
} finally {
$client->endSessions([$session]);
}
@@ -251,7 +249,6 @@ class TransactionTest extends TestCase
$this->assertNotEmpty($found1->cursor->firstBatch);
$this->assertNotEmpty($found2->cursor->firstBatch);
} finally {
$client->endSessions([$session]);
}
@@ -343,7 +340,6 @@ class TransactionTest extends TestCase
$this->assertEquals(1, $count);
$client->commitTransaction($session);
} finally {
$client->endSessions([$session]);
}