mirror of
https://github.com/danog/postgres.git
synced 2024-11-26 12:04:50 +01:00
Increase ref-count before waiting
This commit is contained in:
parent
b056da210d
commit
170266227a
@ -372,13 +372,13 @@ final class PgSqlHandle implements Handle
|
||||
if (isset($this->statements[$name])) {
|
||||
$storage = $this->statements[$name];
|
||||
|
||||
++$storage->refCount;
|
||||
|
||||
if ($storage->promise instanceof Promise) {
|
||||
// Do not return promised prepared statement object, as the $names array may differ.
|
||||
yield $storage->promise;
|
||||
}
|
||||
|
||||
++$storage->refCount;
|
||||
|
||||
return new PgSqlStatement($this, $name, $sql, $names);
|
||||
}
|
||||
|
||||
|
@ -393,13 +393,13 @@ final class PqHandle implements Handle
|
||||
if (isset($this->statements[$name])) {
|
||||
$storage = $this->statements[$name];
|
||||
|
||||
++$storage->refCount;
|
||||
|
||||
if ($storage->promise instanceof Promise) {
|
||||
// Do not return promised prepared statement object, as the $names array may differ.
|
||||
yield $storage->promise;
|
||||
}
|
||||
|
||||
++$storage->refCount;
|
||||
|
||||
return new PqStatement($this, $name, $sql, $names);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user