only run explain on selects

This commit is contained in:
Brion Vibber 2010-12-17 12:08:46 -08:00
parent 0535a3d15c
commit 0e7a283883

View File

@ -45,7 +45,7 @@ class SQLProfilePlugin extends Plugin
function onStartDBQuery($obj, $query, &$result)
{
if (!$this->recursionGuard) {
if (!$this->recursionGuard && preg_match('/\bselect\b/i', $query)) {
$this->recursionGuard = true;
$xobj = clone($obj);
$explain = $xobj->query('EXPLAIN ' . $query);