This commit is contained in:
2021-08-01 19:04:34 +08:00
parent 822f7a7f36
commit b71b45c5c8
5 changed files with 442 additions and 419 deletions
+3 -3
View File
@@ -42,6 +42,8 @@ class Command extends Component
/** @var string */
private string $_modelName;
public string $dbname = '';
private ?PDOStatement $prepare = null;
@@ -130,9 +132,7 @@ class Command extends Component
if (microtime(true) - $time >= 0.02) {
$this->warning('Mysql:' . Json::encode([$this->sql, $this->params]) . (microtime(true) - $time));
}
if ($this->prepare) {
$this->prepare->closeCursor();
}
$this->prepare?->closeCursor();
return $result;
} catch (\Throwable $exception) {
return $this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');