Bug #34129

CachingFramework: pdoBackend duplicate entry

Added by Leon Dietsch over 9 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-02-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The function "set" in the PdoBackend checks if the hash exists and only then removes it.

if ($this->has($entryIdentifier)) {
    $this->remove($entryIdentifier);
}

But the function "has" selects unexpired entries only. If the cache entry is expired it won't be found by "has" and won't get removed before the new entry is created. PDO throws an expection in this case, because "set" tries to add an already existing entry:

SQLSTATE\[23000\]: Integrity constraint violation: 1062 Duplicate entry 'XXX' for key 'PRIMARY'

I suggest to fix this issue by always removing the entry when "set" is called, like the DbBackend does.

I don't know if sqllite would just overwrite the entry. I use the PdoBackend with MySQL.

#1

Updated by Stefan Galinski over 9 years ago

Sounds like you got an idea how to fix that issues. Can you provide a patch and open a new review request please?

http://wiki.typo3.org/Contribution_Walkthrough_Tutorials

#2

Updated by Leon Dietsch over 9 years ago

Never did this before. I'll try to follow the walkthrough.

#3

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9144

#4

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9144

#5

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9144

#6

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9144

#7

Updated by Gerrit Code Review over 8 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9144

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/18098

#9

Updated by Anonymous over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#10

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/18101

#11

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at https://review.typo3.org/18102

#12

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/18103

#13

Updated by Anonymous over 8 years ago

  • Status changed from Under Review to Resolved
#14

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master_new has been pushed to the review server.
It is available at https://review.typo3.org/18626

#15

Updated by Christian Kuhn over 8 years ago

  • Status changed from Under Review to Resolved
#16

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF