From e8990c9be677c8a1e4a5d536c5161d2b60b29789 Mon Sep 17 00:00:00 2001 From: PetrP Date: Mon, 14 Jun 2010 21:29:24 +0800 Subject: [PATCH] DibiProfiler: explain query doesn't overwrite `dibi::$sql` --- dibi/libs/DibiProfiler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dibi/libs/DibiProfiler.php b/dibi/libs/DibiProfiler.php index 845ab615..fb653c80 100644 --- a/dibi/libs/DibiProfiler.php +++ b/dibi/libs/DibiProfiler.php @@ -148,10 +148,12 @@ class DibiProfiler extends DibiObject implements IDibiProfiler, /*Nette\*/IDebug ); if ($this->explainQuery && $event === self::SELECT) { + $tmpSql = dibi::$sql; try { $ticket[5] = dibi::dump($connection->setProfiler(NULL)->nativeQuery('EXPLAIN ' . $sql), TRUE); } catch (DibiException $e) {} $connection->setProfiler($this); + dibi::$sql = $tmpSql; } if ($this->useFirebug && !headers_sent()) {