Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f7b9bb2

Browse filesBrowse files
bug #29900 [Cache] PDO-based cache pool table autocreation does not work (errogaht)
This PR was merged into the 4.2 branch. Discussion ---------- [Cache] PDO-based cache pool table autocreation does not work look at #29898 I believe that it is not good fix... But pgsq table not foutd throwed right there, in execute(). Dont know about another DB drivers, and i dont know will execute() again work or not, please if some one know more about PDO than me, check it! | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29898 | License | MIT Commits ------- 81d3716 [Cache] PDO-based cache pool table autocreation does not work
2 parents a0ea84b + 81d3716 commit f7b9bb2
Copy full SHA for f7b9bb2

File tree

Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed

‎src/Symfony/Component/Cache/Traits/PdoTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/PdoTrait.php
+9-10Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,7 @@ protected function doSave(array $values, $lifetime)
306306

307307
$now = time();
308308
$lifetime = $lifetime ?: null;
309-
try {
310-
$stmt = $conn->prepare($sql);
311-
} catch (TableNotFoundException $e) {
312-
if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) {
313-
$this->createTable();
314-
}
315-
$stmt = $conn->prepare($sql);
316-
}
309+
$stmt = $conn->prepare($sql);
317310

318311
if ('sqlsrv' === $driver || 'oci' === $driver) {
319312
$stmt->bindParam(1, $id);
@@ -340,8 +333,14 @@ protected function doSave(array $values, $lifetime)
340333
}
341334

342335
foreach ($values as $id => $data) {
343-
$stmt->execute();
344-
336+
try {
337+
$stmt->execute();
338+
} catch (TableNotFoundException $e) {
339+
if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) {
340+
$this->createTable();
341+
}
342+
$stmt->execute();
343+
}
345344
if (null === $driver && !$stmt->rowCount()) {
346345
try {
347346
$insertStmt->execute();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.