summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php4
-rw-r--r--lib/private/DB/QueryBuilder/QuoteHelper.php2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
index 6bd98e4ce50..9ec8a9fd3c4 100644
--- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
+++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php
@@ -53,4 +53,8 @@ class FunctionBuilder implements IFunctionBuilder {
return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ')');
}
}
+
+ public function sum($field) {
+ return new QueryFunction('SUM(' . $this->helper->quoteColumnName($field) . ')');
+ }
}
diff --git a/lib/private/DB/QueryBuilder/QuoteHelper.php b/lib/private/DB/QueryBuilder/QuoteHelper.php
index 041718bce5a..705c3a89712 100644
--- a/lib/private/DB/QueryBuilder/QuoteHelper.php
+++ b/lib/private/DB/QueryBuilder/QuoteHelper.php
@@ -73,7 +73,7 @@ class QuoteHelper {
return $string;
}
- return $alias . '.`' . $columnName . '`';
+ return '`' . $alias . '`.`' . $columnName . '`';
}
return '`' . $string . '`';