From 151ee3ee18681a3aadac04e63374c7ad06b62c87 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 25 Jan 2019 15:52:25 +0100 Subject: [PATCH 1/2] fix merge --- .../Tests/Profiler/TemplateManagerTest.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php index 18d4cc44b4..927ee0dba9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php @@ -74,23 +74,6 @@ class TemplateManagerTest extends TestCase $this->assertEquals('FooBundle:Collector:foo.html.twig', $this->templateManager->getName(new ProfileDummy(), 'foo')); } - /** - * template should be loaded for 'foo' because other collectors are - * missing in profile or in profiler. - */ - public function testGetTemplates() - { - $this->profiler->expects($this->any()) - ->method('has') - ->withAnyParameters() - ->will($this->returnCallback([$this, 'profileHasCollectorCallback'])); - - $result = $this->templateManager->getTemplates(new ProfileDummy()); - $this->assertArrayHasKey('foo', $result); - $this->assertArrayNotHasKey('bar', $result); - $this->assertArrayNotHasKey('baz', $result); - } - public function profilerHasCallback($panel) { switch ($panel) { From f419851eb1d63a9c4d1c0c77c1a19486ba4cff81 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 25 Jan 2019 15:56:12 +0100 Subject: [PATCH 2/2] [Cache] fix create table at prepare time --- src/Symfony/Component/Cache/Traits/PdoTrait.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index 6d896fd555..af1a7b22f6 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -306,7 +306,14 @@ trait PdoTrait $now = time(); $lifetime = $lifetime ?: null; - $stmt = $conn->prepare($sql); + try { + $stmt = $conn->prepare($sql); + } catch (TableNotFoundException $e) { + if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) { + $this->createTable(); + } + $stmt = $conn->prepare($sql); + } if ('sqlsrv' === $driver || 'oci' === $driver) { $stmt->bindParam(1, $id);