Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed accidental deletion of referenced cached rows when emptyResultSet is called #207
@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?
$cachedRows = [1,2,3]; $rows = &$cachedRows; $rows = null; // $rows = null // $cachedRows = null
$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: