From 0e7a283883bc82ca2dfa5426c254caf7d749252c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 17 Dec 2010 12:08:46 -0800 Subject: [PATCH] only run explain on selects --- plugins/SQLProfile/SQLProfilePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SQLProfile/SQLProfilePlugin.php b/plugins/SQLProfile/SQLProfilePlugin.php index 035c56c280..1e49d9005e 100644 --- a/plugins/SQLProfile/SQLProfilePlugin.php +++ b/plugins/SQLProfile/SQLProfilePlugin.php @@ -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); -- 2.39.2