aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2024-08-29 19:12:44 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2024-08-29 19:12:44 +0200
commit381e922085d6460ff45c2d76cb82de1393afb379 (patch)
tree40a344adcb33193b3b0fe617223b6fe09fa1c843 /lib/private/DB
parente44f24f7abb92b1d580b211cf9857eb99a0cb0f9 (diff)
downloadnextcloud-server-381e922085d6460ff45c2d76cb82de1393afb379.tar.gz
nextcloud-server-381e922085d6460ff45c2d76cb82de1393afb379.zip
fix(DB): set sharding parameters only when intended
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/ConnectionFactory.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php
index 8f161b68ecb..8d662b0508c 100644
--- a/lib/private/DB/ConnectionFactory.php
+++ b/lib/private/DB/ConnectionFactory.php
@@ -225,11 +225,16 @@ class ConnectionFactory {
}
$connectionParams['sharding'] = $this->config->getValue('dbsharding', []);
- $connectionParams['shard_connection_manager'] = $this->shardConnectionManager;
- $connectionParams['auto_increment_handler'] = new AutoIncrementHandler(
- $this->cacheFactory,
- $this->shardConnectionManager,
- );
+ if (!empty($connectionParams['sharding'])) {
+ $connectionParams['shard_connection_manager'] = $this->shardConnectionManager;
+ $connectionParams['auto_increment_handler'] = new AutoIncrementHandler(
+ $this->cacheFactory,
+ $this->shardConnectionManager,
+ );
+ } else {
+ // just in case only the presence could lead to funny behaviour
+ unset($connectionParams['sharding']);
+ }
$connectionParams = array_merge($connectionParams, $additionalConnectionParams);