mc12345678:
Well, following the little threads related to this issue some more, it looks like the function sql_cache_store is subject to the same potential race condition as identified in that other post. My apologies for not picking up on the difference of code section(s) between the two. The error message originally reported dealt with sql_cache_store, where the suggested fix was in the sessions file of a different function. That said it appears that the same fix could be applied here if it hasn't already.
case 'database':
$result_serialize = $db->prepare_input(base64_encode(serialize($zf_result_array)));
$sql = "insert ignore into " . TABLE_DB_CACHE . " (cache_entry_name, cache_data, cache_entry_created) values
('" . $zp_cache_name . "', '" . $result_seialize . "', '" . time() . "')";
$db->Execute($sql);
$sql = "update " . TABLE_DB_CACHE . " set cache_entry_name = '" .$zp_cache_name . "',
cache_data = '" . $result_seialize . "',
cache_entry_created = '" . time() . "'";
$db->Execute($sql);
return true;
break;
>
> With the above code to replace the case statement for database entirely (assuming that I typed it 100% correctly.
>
> Again, sorry for the slight misdirection, though perhaps solved two problems in one thread?! :)
> **DrByte:**
>
> A possible fix (as eluded to by mc12345678) could be:
> a) /includes/classes/cache.php. Around line 128 you'll see:```
$sql = "insert into " . TABLE_DB_CACHE . " set cache_entry_name = '" . $zp_cache_name . "',
Change that to:```
$sql = "insert [B]IGNORE [/B]into" . TABLE_DB_CACHE . " set cache_entry_name = '" . $zp_cache_name . "',
>
> b) Then turn it back on by setting SQL_CACHE_METHOD back to 'database' temporarily in your /includes/configure.php file.
>
> Then do whatever it is you've been doing to cause the debug logs previously, and confirm whether they continue or not. If they continue, does the error message change? To what?
FWIW, above I suggested some code changes for the cache files. I recommend *NOT* implementing these now that I've taken a moment to think. The cache system is designed to provide a temporary relief from looking up the same information multiple times within a short period of time. The changes suggested above (by me) would keep the data resident as long as that data was trying to be cached before expiration.
This is desired for sessions, but not caching and why the alternate code provided above is preferred (though still awaiting result review.)
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...