Skip to content

Commit

Permalink
ConnectionPanel: params are useless for EXPLAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 13, 2019
1 parent 46e2302 commit f9fc19d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Bridges/DatabaseTracy/ConnectionPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ public function getPanel(): ?string
$totalTime = $this->totalTime;
$queries = [];
foreach ($this->queries as $query) {
[$connection, $sql, $params, , , , $error] = $query;
[$connection, $sql, , , , , $error] = $query;
$explain = null;
$command = preg_match('#\s*\(?\s*(SELECT|INSERT|UPDATE|DELETE)\s#iA', $sql, $m) ? strtolower($m[1]) : null;
if (!$error && $this->explain && $command === 'select') {
try {
$cmd = is_string($this->explain) ? $this->explain : 'EXPLAIN';
$explain = $connection->queryArgs("$cmd $sql", $params)->fetchAll();
$explain = $connection->queryArgs("$cmd $sql", [])->fetchAll();
} catch (\PDOException $e) {
}
}
Expand Down

0 comments on commit f9fc19d

Please sign in to comment.