Index: /develop/projects/wiesfurthstr/t3lib/class.t3lib_db.php =================================================================== --- /develop/projects/wiesfurthstr/t3lib/class.t3lib_db.php (revision 3137) +++ /develop/projects/wiesfurthstr/t3lib/class.t3lib_db.php (working copy) @@ -1152,7 +1152,8 @@ * @return boolean True if explain was run, false otherwise */ protected function explain($query,$from_table,$row_count) { - + $sqlParserObj = t3lib_div::makeInstance('t3lib_sqlparser'); + $from_table = $sqlParserObj->trimSQL($from_table); if ((int)$this->explainOutput==1 || ((int)$this->explainOutput==2 && t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))) { $explainMode = 1; // raw HTML output } elseif ((int)$this->explainOutput==3 && is_object($GLOBALS['TT'])) { @@ -1176,13 +1177,21 @@ $indices_output = array(); if ($explain_output[0]['rows']>1 || t3lib_div::inList('ALL',$explain_output[0]['type'])) { $debug = true; // only enable output if it's really useful - - $res = $this->sql_query('SHOW INDEX FROM '.$from_table, $this->link); - if (is_resource($res)) { - while ($tempRow = $this->sql_fetch_assoc($res)) { - $indices_output[] = $tempRow; + + $fromPartsArray = $sqlParserObj->parseFromTables($from_table); + // Split the From Part by the Buildin Parser + // if parser is succesfull, the rsult is an array + if (is_array($fromPartsArray)) { + $fromParts = $sqlParserObj->compileFromTables($fromPartsArray); + foreach ((explode(',',$fromParts)) as $oneTable) { + $res = $this->sql_query('SHOW INDEX FROM '.$oneTable, $this->link); + if (is_resource($res)) { + while ($tempRow = $this->sql_fetch_assoc($res)) { + $indices_output[] = $tempRow; + } + $this->sql_free_result($res); + } } - $this->sql_free_result($res); } } else { $debug = false; @@ -1216,7 +1225,7 @@ $data['explain'] = $explain_output; } if (count($indices_output)) { - $data['indices'] = $indices; + $data['indices'] = $indices_output; } $GLOBALS['TT']->setTSselectQuery($data); }