Project

General

Profile

Actions

Bug #18253

closed

Duplicate entry on cache_pagesection on reloading twice

Added by Ivan Gomez about 16 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2008-02-19
Due date:
% Done:

0%

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

Description

If I reload a page in the frontend twice or two or more persons access the same page at almost the same time, an SQL error in tabe cache_pagesection is show.

That's a concurrence problem incorrectly fixed in http://bugs.typo3.org/view.php?id=4581

That's a concurrence problem is in that piece of code.

Two or more users can do the insert at same time . There aren't transactions or another way to control concurrence and then we can't assume that condition ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 0) is true when a process do the insert because another process could do the insert before.

$GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_pagesection', 'page_id=' . intval($GLOBALS['TSFE']->id) . ' AND mpvar_hash=' . $mpvar_hash, $dbFields);

if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 0) {
$dbFields['page_id'] = intval($GLOBALS['TSFE']->id);
$dbFields['mpvar_hash'] = $mpvar_hash;
// HERE ===> two or more execs at the same time
$GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_pagesection', $dbFields);

}

(issue imported from #M7591)


Files

bug_0007591.patch (1.26 KB) bug_0007591.patch Administrator Admin, 2008-02-19 13:34
bug_0007591_without_on_duplicate_key_update.patch (1.21 KB) bug_0007591_without_on_duplicate_key_update.patch Administrator Admin, 2008-02-21 10:56
patch-insert-on-duplicate-key (1.12 KB) patch-insert-on-duplicate-key Administrator Admin, 2008-04-25 17:59

Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Bug #17088: "Duplicate entry" in cache_pagesection when using framesClosedMichael Stucki2007-03-07

Actions
Related to TYPO3 Core - Bug #16751: Duplicate entry on cache_pagesection on reloading twiceClosedMichael Stucki2006-11-29

Actions
Related to TYPO3 Core - Bug #23116: Bug #18253 has not been solved [Duplicate entry on cache_pagesection on reloading twice]Closed2010-07-07

Actions
Has duplicate TYPO3 Core - Bug #18252: Duplicate entry on cache_pagesection on reloading twiceClosedChristian Kuhn2008-02-19

Actions
Is duplicate of TYPO3 Core - Bug #19621: getTreeList causes duplicate entry sql errorClosedRupert Germann2008-11-18

Actions
Actions

Also available in: Atom PDF