From: Brion Vibber Date: Fri, 17 Dec 2010 20:08:46 +0000 (-0800) Subject: only run explain on selects X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0e7a283883bc82ca2dfa5426c254caf7d749252c;p=quix0rs-gnu-social.git only run explain on selects --- 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);