mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function sqlHavingToString($having) {
|
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
|
// these clauses only make sense in SELECT queries, not DELETE
|
||||||
if(!$query->getDelete()) {
|
if(!$query->getDelete()) {
|
||||||
if($query->getGroupBy()) $text .= $this->sqlGroupByToString($query->getGroupBy());
|
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->getOrderBy()) $text .= $this->sqlOrderByToString($query->getOrderBy());
|
||||||
if($query->getLimit()) $text .= $this->sqlLimitToString($query->getLimit());
|
if($query->getLimit()) $text .= $this->sqlLimitToString($query->getLimit());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user