Fixed bug #14394: Better debug output for SQL Explain
authorSteffen Kamper <info@sk-typo3.de>
Wed, 26 May 2010 09:27:44 +0000 (09:27 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 26 May 2010 09:27:44 +0000 (09:27 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7678 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_db.php

index 5667a5f..38bd451 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 
 2010-05-26  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14394: Better debug output for SQL Explain
        * Fixed bug #14466: Bug: SpriteIconApi getSpriteIconForRecord does not find default icon (thanks to Steffen Ritter)
        * Follow-up to bug #13379: Sprite Icon API (thanks to Steffen Ritter)
        * Follow-up to bug #14324: Feature: Add spriteGeneratorAPI to support the new sprite-icon-api (thanks to Steffen Ritter)
index ccdf1b6..904828a 100644 (file)
@@ -1485,21 +1485,7 @@ class t3lib_DB {
                }
 
                if ($debug) {
-                       if ($explainMode == 1) {
-                               t3lib_div::debug('QUERY: ' . $query);
-                               t3lib_div::debug(array('Debug trail:' => $trail), 'Row count: ' . $row_count);
-
-                               if ($error) {
-                                       t3lib_div::debug($error);
-                               }
-                               if (count($explain_output)) {
-                                       t3lib_div::debug($explain_output);
-                               }
-                               if (count($indices_output)) {
-                                       t3lib_div::debugRows($indices_output);
-                               }
-
-                       } elseif ($explainMode == 2) {
+                       if ($explainMode) {
                                $data = array();
                                $data['query'] = $query;
                                $data['trail'] = $trail;
@@ -1514,7 +1500,12 @@ class t3lib_DB {
                                if (count($indices_output)) {
                                        $data['indices'] = $indices_output;
                                }
-                               $GLOBALS['TT']->setTSselectQuery($data);
+
+                               if ($explainMode == 1) {
+                                       t3lib_div::debug($data, 'Tables: ' . $from_table, 'DB SQL EXPLAIN');
+                               } elseif ($explainMode == 2) {
+                                       $GLOBALS['TT']->setTSselectQuery($data);
+                               }
                        }
                        return true;
                }