]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
only run explain on selects
authorBrion Vibber <brion@pobox.com>
Fri, 17 Dec 2010 20:08:46 +0000 (12:08 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 17 Dec 2010 20:08:46 +0000 (12:08 -0800)
plugins/SQLProfile/SQLProfilePlugin.php

index 035c56c2806d4372e55c0ce3a72deef8f71b2d03..1e49d9005ee981aa87199f2841601c9b6eb16dfc 100644 (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);