mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Remove order from groupConcat as it is not working everywhere
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
189f9f96ce
commit
d850dc0220
6 changed files with 7 additions and 8 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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 . ')');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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 . ')');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue