[BUGFIX] Always select database number in Redis Cache Backend 01/53401/2
authorKasper Ligaard <kasperligaard+typo3.org@gmail.com>
Tue, 20 Jun 2017 09:36:20 +0000 (11:36 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 4 Jul 2017 20:36:47 +0000 (22:36 +0200)
When using persistent connections, we need to always select the database.

Resolves: #81629
Releases: master, 8.7
Change-Id: Ia514a8ed8f04d1108263c39a21c654de4191db8b
Reviewed-on: https://review.typo3.org/53401
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Cache/Backend/RedisBackend.php

index 4330bcc..32dfc73 100644 (file)
@@ -168,7 +168,7 @@ class RedisBackend extends AbstractBackend implements TaggableBackendInterface
                     throw new \TYPO3\CMS\Core\Cache\Exception('The given password was not accepted by the redis server.', 1279765134);
                 }
             }
-            if ($this->database > 0) {
+            if ($this->database >= 0) {
                 $success = $this->redis->select($this->database);
                 if (!$success) {
                     throw new \TYPO3\CMS\Core\Cache\Exception('The given database "' . $this->database . '" could not be selected.', 1279765144);