diff options
author | Joas Schilling <coding@schilljs.com> | 2022-01-17 11:58:50 +0100 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-01-21 08:39:39 -0300 |
commit | d850dc02207769ef13897867a11083e420f115c4 (patch) | |
tree | c8fc5e666c8e1b49609d6d01042c695acb73ceae /lib | |
parent | 189f9f96ce8a93e228acc5821099d8e870576292 (diff) | |
download | nextcloud-server-d850dc02207769ef13897867a11083e420f115c4.tar.gz nextcloud-server-d850dc02207769ef13897867a11083e420f115c4.zip |
Remove order from groupConcat as it is not working everywhere
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
6 files changed, 7 insertions, 8 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 95fb7f24e53..a4afffe2cd4 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -1233,7 +1233,7 @@ class Manager implements ICommentsManager { ->selectAlias( $jsonQuery->func()->concat( $jsonQuery->expr()->literal('{'), - $jsonQuery->func()->groupConcat('colonseparatedvalue', ','), + $jsonQuery->func()->groupConcat('colonseparatedvalue'), $jsonQuery->expr()->literal('}') ), 'json' diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php index ba59f42ce5d..03630ea14a3 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php @@ -59,7 +59,7 @@ class FunctionBuilder implements IFunctionBuilder { return new QueryFunction(sprintf('CONCAT(%s)', implode(', ', $list))); } - public function groupConcat($expr, ?string $separator = ',', ?string $orderBy = null): IQueryFunction { + public function groupConcat($expr, ?string $separator = ','): IQueryFunction { $separator = $this->connection->quote($separator); return new QueryFunction('GROUP_CONCAT(' . $this->helper->quoteColumnName($expr) . ' SEPARATOR ' . $separator . ')'); } diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php index 77f14a2dda4..43ecf599eba 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php @@ -82,8 +82,8 @@ class OCIFunctionBuilder extends FunctionBuilder { return new QueryFunction(sprintf('(%s)', implode(' || ', $list))); } - public function groupConcat($expr, ?string $separator = ',', ?string $orderBy = 'NULL'): IQueryFunction { - $orderByClause = ' WITHIN GROUP(ORDER BY ' . $orderBy . ')'; + public function groupConcat($expr, ?string $separator = ','): IQueryFunction { + $orderByClause = ' WITHIN GROUP(ORDER BY NULL)'; if (is_null($separator)) { return new QueryFunction('LISTAGG(' . $this->helper->quoteColumnName($expr) . ')' . $orderByClause); } diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php index 3a1d9a56734..444f6aa83a4 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php @@ -37,7 +37,7 @@ class PgSqlFunctionBuilder extends FunctionBuilder { return new QueryFunction(sprintf('(%s)', implode(' || ', $list))); } - public function groupConcat($expr, ?string $separator = ',', ?string $orderBy = null): IQueryFunction { + public function groupConcat($expr, ?string $separator = ','): IQueryFunction { $castedExpression = $this->queryBuilder->expr()->castColumn($expr, IQueryBuilder::PARAM_STR); if (is_null($separator)) { diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php index cfcabc9eb1a..fe700075a82 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/SqliteFunctionBuilder.php @@ -36,7 +36,7 @@ class SqliteFunctionBuilder extends FunctionBuilder { return new QueryFunction(sprintf('(%s)', implode(' || ', $list))); } - public function groupConcat($expr, ?string $separator = ',', ?string $orderBy = null): IQueryFunction { + public function groupConcat($expr, ?string $separator = ','): IQueryFunction { $separator = $this->connection->quote($separator); return new QueryFunction('GROUP_CONCAT(' . $this->helper->quoteColumnName($expr) . ', ' . $separator . ')'); } diff --git a/lib/public/DB/QueryBuilder/IFunctionBuilder.php b/lib/public/DB/QueryBuilder/IFunctionBuilder.php index 9b0c7254250..04c5cbd07bd 100644 --- a/lib/public/DB/QueryBuilder/IFunctionBuilder.php +++ b/lib/public/DB/QueryBuilder/IFunctionBuilder.php @@ -62,11 +62,10 @@ interface IFunctionBuilder { * * @param string|IQueryFunction $expr The expression to group * @param string|null $separator The separator - * @param string|null $orderBy Option only used to make compatible with Oracle database if is necessary use order. The default value is null and the Oracle don't will respect the order by of query * @return IQueryFunction * @since 24.0.0 */ - public function groupConcat($expr, ?string $separator = ',', ?string $orderBy = null): IQueryFunction; + public function groupConcat($expr, ?string $separator = ','): IQueryFunction; /** * Takes a substring from the input string |