mirror of
https://github.com/danog/postgres.git
synced 2025-01-22 05:11:14 +01:00
Unset statement cache if prepare fails
This commit is contained in:
parent
588d4ff4c6
commit
b76ff0f5d9
@ -277,7 +277,12 @@ class PgSqlExecutor implements Executor {
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
});
|
||||
$storage->promise->onResolve(function () use ($storage) {
|
||||
$storage->promise->onResolve(function ($exception) use ($storage, $name) {
|
||||
if ($exception) {
|
||||
unset($this->statements[$name]);
|
||||
return;
|
||||
}
|
||||
|
||||
$storage->promise = null;
|
||||
});
|
||||
return $storage->promise;
|
||||
|
@ -273,7 +273,12 @@ class PqExecutor implements Executor {
|
||||
$storage->statement = $statement;
|
||||
return new PqStatement($statement, $this->send, $this->deallocate);
|
||||
});
|
||||
$storage->promise->onResolve(function () use ($storage) {
|
||||
$storage->promise->onResolve(function ($exception) use ($storage, $name) {
|
||||
if ($exception) {
|
||||
unset($this->statements[$name]);
|
||||
return;
|
||||
}
|
||||
|
||||
$storage->promise = null;
|
||||
});
|
||||
return $storage->promise;
|
||||
|
Loading…
x
Reference in New Issue
Block a user