Fixed accidental deletion of referenced cached rows when emptyResultSet is called#207
Fixed accidental deletion of referenced cached rows when emptyResultSet is called#207dg merged 3 commits intonette:masterfrom
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 = nullvs $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