mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Ensure end bracket for HAVING clause is put in the right place
This commit is contained in:
parent
5f5197b4c1
commit
e50f90bf8e
@ -783,7 +783,7 @@ abstract class SS_Database {
|
||||
* @return string
|
||||
*/
|
||||
public function sqlHavingToString($having) {
|
||||
return ' HAVING ( ' . implode(' ) AND ( ', $having);
|
||||
return ' HAVING ( ' . implode(' ) AND ( ', $having) . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -829,7 +829,7 @@ abstract class SS_Database {
|
||||
// these clauses only make sense in SELECT queries, not DELETE
|
||||
if(!$query->getDelete()) {
|
||||
if($query->getGroupBy()) $text .= $this->sqlGroupByToString($query->getGroupBy());
|
||||
if($query->getHaving()) $text .= $this->sqlHavingToString($query->getHaving()) . ' )';
|
||||
if($query->getHaving()) $text .= $this->sqlHavingToString($query->getHaving());
|
||||
if($query->getOrderBy()) $text .= $this->sqlOrderByToString($query->getOrderBy());
|
||||
if($query->getLimit()) $text .= $this->sqlLimitToString($query->getLimit());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user