aboutsummaryrefslogtreecommitdiffstats
path: root/includes/objectcache
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2024-08-07 19:17:09 -0700
committerAaron Schulz <aschulz@wikimedia.org>2024-08-07 19:17:39 -0700
commitd680a916cc8c12c99660fa3bf5c89b260de0d6c4 (patch)
tree273cb83ead10ba1c129501ff1610022db56a424b /includes/objectcache
parent7c140bd0404c16271d20a17056b2c07b4c9ca93f (diff)
downloadmediawikicore-d680a916cc8c12c99660fa3bf5c89b260de0d6c4.tar.gz
mediawikicore-d680a916cc8c12c99660fa3bf5c89b260de0d6c4.zip
objectcache: make SqlBagOStuff correctly ignore DBO_DEFAULT
Generally, configuration has 0 or DBO_DEFAULT, not DBO_TRX. Also, clearing DBO_TRX does not stop it from getting set again due to DBO_DEFAULT in DatabaseFactory::create(). Change-Id: Ie958475c9706199bd4f474f55565c8a9a32f1291
Diffstat (limited to 'includes/objectcache')
-rw-r--r--includes/objectcache/SqlBagOStuff.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php
index 4cc0e551e3d6..766af8cc8b0e 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -1700,9 +1700,9 @@ class SqlBagOStuff extends MediumSpecificBagOStuff {
private function getConnectionFromServerInfo( $shardIndex, array $server ) {
if ( !isset( $this->conns[$shardIndex] ) ) {
$server['logger'] = $this->logger;
- // Make sure this handle always uses autocommit mode, even if DBO_TRX is
- // configured.
- $server['flags'] &= ~DBO_TRX;
+ // Always use autocommit mode, even if DBO_TRX is configured
+ $server['flags'] ??= 0;
+ $server['flags'] &= ~( IDatabase::DBO_TRX | IDatabase::DBO_DEFAULT );
/** @var IMaintainableDatabase $conn Auto-commit connection to the server */
$conn = MediaWikiServices::getInstance()->getDatabaseFactory()