From b8bd5808e868ada2bb1755cfa06f59314c16c1c8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Jul 2017 11:34:35 +0200 Subject: [PATCH] Add brackets around concat statements so comparing the result works as intended Signed-off-by: Joas Schilling --- .../DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php | 2 +- .../DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php index 27ebf1a04f..26aedb9a8b 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.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) . ')'); } } diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php index e985b7306a..f38445a6d3 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php @@ -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) . ')'); } }