Project

General

Profile

Bug #21780 » 12897_core.diff

Administrator Admin, 2009-12-03 11:32

View differences:

t3lib/class.t3lib_sqlparser.php (working copy)
$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)) {
......
* 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:
......
$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;
}
/**
(1-1/2)