[TYPO3-core] RFC: Bug 4581: Duplicate entry on cache_pagesection on reloading twice

Ingmar Schlecht ingmar at typo3.org
Wed Jan 24 14:25:29 CET 2007


Hi Dmity,

Dmitry Dulepov wrote:
> I would not give +1 because I believe that this solution does not solve
> the problem :(

Did you closely read Oliver's description? I think it sounds very
reasonable, what he's saying.

Here's what Oliver wrote again:
> mysql_affected_rows [1] also fails (returns zero) if the records exists
> but wasn't updated because old values were equal to new values. And then
> also an INSERT is sent. And this produces the "duplicate entry" error.

That clearly shows that it's useful to use sql_info() instead of
mysql_affected_rows(), doesn't it?

Without Oliver's patch:
(1) UPDATE -> succeeds
(2) UPDATE -> succeeds, but TYPO3 thinks it didn't because
              mysql_affected_rows() == 0
(2) INSERT -> fails

With Oliver's patch:
(1) UPDATE -> succeeds
(2) UPDATE -> succeeds, and TYPO3 knows that it succeeds because
              $sql_info['rowsmatched'] == 1

+1 from me, but I would like to hear Karsten's opinion first as he might
know better whether it's a good idea to introduce sql_info() to t3lib_db
from an DBAL perspective.

cheers
Ingmar


More information about the TYPO3-team-core mailing list