Merge pull request #5922 from nextcloud/master-add-brackets-on-concat-method

[master]Add brackets around concat statements so comparing the result works as intended
This commit is contained in:
Roeland Jago Douma 2017-07-31 08:49:59 +02:00 committed by GitHub
commit 13469ec49c
2 changed files with 2 additions and 2 deletions

View File

@ -25,6 +25,6 @@ use OC\DB\QueryBuilder\QueryFunction;
class PgSqlFunctionBuilder extends FunctionBuilder {
public function concat($x, $y) {
return new QueryFunction($this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y));
return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')');
}
}

View File

@ -25,6 +25,6 @@ use OC\DB\QueryBuilder\QueryFunction;
class SqliteFunctionBuilder extends FunctionBuilder {
public function concat($x, $y) {
return new QueryFunction($this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y));
return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')');
}
}