Skip to content

Commit

Permalink
Do not call CommandInterface::getRawSql() if no logger or profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Nov 22, 2023
1 parent 8a3d81f commit cbcdd5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Driver/Pdo/AbstractPdoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ protected function logQuery(string $rawSql, string $category): void

protected function queryInternal(int $queryMode): mixed
{
$rawSql = $this->getRawSql();
$rawSql = '';

if ($this->logger !== null || $this->profiler !== null) {
$rawSql = $this->getRawSql();
}

$logCategory = self::class . '::' . $this->getQueryMode($queryMode);

$this->logQuery($rawSql, $logCategory);
Expand Down

0 comments on commit cbcdd5e

Please sign in to comment.