This commit is contained in:
as2252258@163.com
2021-05-02 14:33:05 +08:00
parent 08f664369f
commit 7e7d63969b
+3 -3
View File
@@ -121,14 +121,14 @@ class Command extends Component
private function execute($type, $isInsert = null, $hasAutoIncrement = null): int|bool|array|string|null private function execute($type, $isInsert = null, $hasAutoIncrement = null): int|bool|array|string|null
{ {
try { try {
if ($this->prepare) {
$this->prepare->closeCursor();
}
if ($type === static::EXECUTE) { if ($type === static::EXECUTE) {
$result = $this->insert_or_change($isInsert, $hasAutoIncrement); $result = $this->insert_or_change($isInsert, $hasAutoIncrement);
} else { } else {
$result = $this->search($type); $result = $this->search($type);
} }
if ($this->prepare) {
$this->prepare->closeCursor();
}
return $result; return $result;
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
return $this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql'); return $this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');