Add brackets around concat statements so comparing the result works as intended

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/5922/head
Joas Schilling 9 years ago committed by Lukas Reschke
parent 09e7d12157
commit 50912fb94f
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
  1. 2
      lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php
  2. 2
      lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php

@ -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) . ')');
}
}

@ -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) . ')');
}
}

Loading…
Cancel
Save