diff --git a/.github/workflows/coding-style.yml b/.github/workflows/coding-style.yml index 79c9babf1..53d0ed324 100644 --- a/.github/workflows/coding-style.yml +++ b/.github/workflows/coding-style.yml @@ -7,7 +7,7 @@ jobs: name: Nette Code Checker runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: 7.2 @@ -21,7 +21,7 @@ jobs: name: Nette Coding Standard runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: 8.0 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 18e8ae5be..30afa4ad5 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -10,7 +10,7 @@ jobs: name: PHPStan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: 7.4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f148c23e7..edeaf9a26 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,12 +3,12 @@ name: Tests on: [push, pull_request] env: - php-extensions: mbstring, intl, pdo_sqlsrv-5.10.0beta2 + php-extensions: mbstring, intl, pdo_sqlsrv-5.12.0 php-tools: "composer:v2, pecl" jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] @@ -43,7 +43,6 @@ jobs: --health-retries=5 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=nette_test - --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" postgres96: image: postgres:9.6 @@ -83,13 +82,13 @@ jobs: - 1433:1433 options: >- --name=mssql - --health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" + --health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1' -N -C" --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -101,7 +100,7 @@ jobs: run: cp ./tests/databases.github.ini ./tests/Database/databases.ini - name: Create MS SQL Database - run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE nette_test' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE nette_test' -N -C - run: composer install --no-progress --prefer-dist - run: vendor/bin/tester tests -s -C @@ -116,7 +115,7 @@ jobs: name: Lowest Dependencies runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: 8.0 diff --git a/src/Database/Table/GroupedSelection.php b/src/Database/Table/GroupedSelection.php index a24e9df40..2e31410a1 100644 --- a/src/Database/Table/GroupedSelection.php +++ b/src/Database/Table/GroupedSelection.php @@ -222,7 +222,6 @@ protected function loadRefCache(): void $this->observeCache = &$referencing['observeCache']; $this->refCacheCurrent = &$referencing[$hash]; $this->accessedColumns = &$referencing[$hash]['accessed']; - $this->specificCacheKey = &$referencing[$hash]['specificCacheKey']; $this->rows = &$referencing[$hash]['rows']; if (isset($referencing[$hash]['data'][$this->active])) { diff --git a/src/Database/Table/Selection.php b/src/Database/Table/Selection.php index 1ce54940e..3834f2ebd 100644 --- a/src/Database/Table/Selection.php +++ b/src/Database/Table/Selection.php @@ -989,6 +989,7 @@ public function getReferencingTable(string $table, ?string $column = null, $acti if (!$prototype) { $prototype = $this->createGroupedSelectionInstance($table, $column); $prototype->where("$table.$column", array_keys((array) $this->rows)); + $prototype->getSpecificCacheKey(); } $clone = clone $prototype; diff --git a/tests/Database/Explorer/Explorer.cache.observer.phpt b/tests/Database/Explorer/Explorer.cache.observer.phpt index 95e7d34cf..f4b8e1956 100644 --- a/tests/Database/Explorer/Explorer.cache.observer.phpt +++ b/tests/Database/Explorer/Explorer.cache.observer.phpt @@ -17,7 +17,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../files/{$driverN $cacheStorage = Mockery::mock(Nette\Caching\Istorage::class); $cacheStorage->shouldReceive('read')->withAnyArgs()->once()->andReturn(['id' => true]); -$cacheStorage->shouldReceive('read')->withAnyArgs()->times(4)->andReturn(['id' => true, 'author_id' => true]); +$cacheStorage->shouldReceive('read')->withAnyArgs()->times(2)->andReturn(['id' => true, 'author_id' => true]); $cacheStorage->shouldReceive('write')->with(Mockery::any(), ['id' => true, 'author_id' => true, 'title' => true], []); $explorer = new Nette\Database\Explorer($connection, $structure, $conventions, $cacheStorage);