[BUGFIX] Prevent orphaned tags in Typo3DatabaseBackend 09/49309/10
authorThomas Schlumberger <thomas@b13.de>
Tue, 2 Aug 2016 12:29:58 +0000 (14:29 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 12 Sep 2016 23:38:23 +0000 (01:38 +0200)
commit3e74ca52d749befdcbd5b400de9da4dba5d2c9fe
tree94d601a7b2ce37fc539d82af3937f10849a22771
parent2afce4397f209a9461210377fbb1d52436c82dcb
[BUGFIX] Prevent orphaned tags in Typo3DatabaseBackend

The 7.6 and 6.2 implementation of Typo3DatabaseBackend cache backend has
bugs in two methods (in mysql-non-dbal versions). Those were introduced
by #61814 and fixed in master with #77160.

flushByTag() leaves orphaned tags in tags table - if a row has two tags
and flushByTag() is executed on one tag, the other is left.

collectGargabe() does not find orphaned tags collectGarbage() and does
not delete an expired cache row if it has no tags (fix: left outer join)

The patch migrates the functional tests and fixes the issue.

Change-Id: Ie53f54eceb3e47c21c31e7263a3f855b1cb93660
Resolves: #77204
Releases: 7.6, 6.2
Reviewed-on: https://review.typo3.org/49309
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/Typo3DatabaseBackend.php
typo3/sysext/core/Tests/Functional/Cache/Backend/Typo3DatabaseBackendTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php