Skip to content

Commit 6dd0dfd

Browse files
committed
fixed performance issue of ActiveRow [Closes #312]
1 parent c4bfab4 commit 6dd0dfd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Database/Table/Selection.php

+1
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ public function getReferencingTable(string $table, ?string $column = null, $acti
989989
if (!$prototype) {
990990
$prototype = $this->createGroupedSelectionInstance($table, $column);
991991
$prototype->where("$table.$column", array_keys((array) $this->rows));
992+
$prototype->getSpecificCacheKey();
992993
}
993994

994995
$clone = clone $prototype;

tests/Database/Explorer/Explorer.cache.observer.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../files/{$driverN
1717

1818
$cacheStorage = Mockery::mock(Nette\Caching\Istorage::class);
1919
$cacheStorage->shouldReceive('read')->withAnyArgs()->once()->andReturn(['id' => true]);
20-
$cacheStorage->shouldReceive('read')->withAnyArgs()->times(4)->andReturn(['id' => true, 'author_id' => true]);
20+
$cacheStorage->shouldReceive('read')->withAnyArgs()->times(2)->andReturn(['id' => true, 'author_id' => true]);
2121
$cacheStorage->shouldReceive('write')->with(Mockery::any(), ['id' => true, 'author_id' => true, 'title' => true], []);
2222

2323
$explorer = new Nette\Database\Explorer($connection, $structure, $conventions, $cacheStorage);

0 commit comments

Comments
 (0)