* ProjectManager/PostgreSQL: fix SQL error in project-list caused by new resources column

fix columns containing commas as part of function calls getting split incorrect in fix_group_by_columns
This commit is contained in:
Ralf Becker 2015-02-16 10:24:29 +00:00
parent 6fce59832d
commit 5c82ac5465

View File

@ -1145,6 +1145,18 @@ class so_sql
if (!is_array($columns))
{
$columns = preg_split('/, */', $columns);
// fix columns containing commas as part of function calls
for($n = 0; $n < count($columns); ++$n)
{
$col =& $columns[$n];
while (substr_count($col, '(') > substr_count($col, ')') && ++$n < count($columns))
{
$col .= ','.$columns[$n];
unset($columns[$n]);
}
}
unset($col);
}
foreach($columns as $n => $col)
{