diff options
author | Joas Schilling <coding@schilljs.com> | 2017-07-28 12:34:35 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-09-22 17:04:24 +0300 |
commit | 12df8dd69fbd374faa720164637c4241b06cc201 (patch) | |
tree | 6171f2507564963b98187802f519a2eb42bfb6d8 /lib/private | |
parent | f1b7dbf46b712d7dbda042b944812ea633cb20aa (diff) |
Add brackets around concat statements so comparing the result works as intended
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php | 2 | ||||
-rw-r--r-- | lib/private/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 b6a7dce46eb..605135ac187 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php @@ -24,6 +24,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 20b30d0ab3a..c6cef9550e5 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php @@ -24,6 +24,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) . ')'); } } |