Index: t3lib/class.t3lib_sqlparser.php =================================================================== --- t3lib/class.t3lib_sqlparser.php (revision 6594) +++ t3lib/class.t3lib_sqlparser.php (working copy) @@ -685,6 +685,9 @@ $this->lastStopKeyWord = ''; $this->parse_error = ''; + // Parse any SQL hint + $stack[$pnt]['sql_hints'] = $this->nextPart($parseString, '^(\/\*.*\*\/)'); + // $parseString is continously shortend by the process and we keep parsing it till it is zero: while (strlen($parseString)) { @@ -1489,16 +1492,18 @@ * Can also compile field lists for ORDER BY and GROUP BY. * * @param array Array of select fields, (made with ->parseFieldList()) + * @param boolean Whether SQL hints should be compiled * @return string Select field string * @see parseFieldList() */ - public function compileFieldList($selectFields) { + public function compileFieldList($selectFields, $compileSqlHints = TRUE) { // Prepare buffer variable: - $outputParts = array(); + $fields = ''; // Traverse the selectFields if any: if (is_array($selectFields)) { + $outputParts = array(); foreach($selectFields as $k => $v) { // Detecting type: @@ -1521,10 +1526,13 @@ $outputParts[$k].= ' '.$v['sortDir']; } } + if ($compileSqlHints && $selectFields[0]['sql_hints']) { + $fields = $selectFields[0]['sql_hints'] . ' '; + } + $fields .= implode(', ', $outputParts); } - // Return imploded buffer: - return implode(', ',$outputParts); + return $fields; } /**