New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed accidental deletion of referenced cached rows when emptyResultSet is called #207
Conversation
Wow, thanks! |
@Unlink This fix causes test deleteCahceBug to fail on sqlsrv. But I'm not sure what exactly is tested on line 61 where exception 'Nette\InvalidStateException: Database refetch failed; row with signature '4' does not exist!' is thrown. Could you please explain if it is problem? |
@Unlink Nevermind. It failed even before this change. |
@MartinMystikJonas May I ask how does the fix work? Why assigning |
Yep, I'm interested too. |
$cachedRows = [1,2,3];
$rows = &$cachedRows;
$rows = null;
// $rows = null
// $cachedRows = null vs $cachedRows = [1,2,3];
$rows = &$cachedRows;
$null = null;
$rows = &$null;
// $rows = null
// $cachedRows = [1,2,3] When $rows value is reference to cache and null is assigned then referenced data in cache are corrupted. Assigning new reference moves reference to different location and left cached data intact. Rows have assigned value by reference from cache here:
|
Fixed cause of #187