mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Fix LENGTH function name across databases
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
6e3cd43903
commit
6185e326dc
3 changed files with 13 additions and 1 deletions
|
|
@ -88,7 +88,7 @@ class FunctionBuilder implements IFunctionBuilder {
|
|||
public function charLength($field, $alias = ''): IQueryFunction {
|
||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
|
||||
$quotedName = $this->helper->quoteColumnName($field);
|
||||
return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias);
|
||||
return new QueryFunction('CHAR_LENGTH(' . $quotedName . ')' . $alias);
|
||||
}
|
||||
|
||||
public function max($field): IQueryFunction {
|
||||
|
|
|
|||
|
|
@ -78,4 +78,10 @@ class OCIFunctionBuilder extends FunctionBuilder {
|
|||
$quotedName = $this->helper->quoteColumnName($field);
|
||||
return new QueryFunction('LENGTHB(' . $quotedName . ')' . $alias);
|
||||
}
|
||||
|
||||
public function charLength($field, $alias = ''): IQueryFunction {
|
||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
|
||||
$quotedName = $this->helper->quoteColumnName($field);
|
||||
return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,4 +44,10 @@ class SqliteFunctionBuilder extends FunctionBuilder {
|
|||
$quotedName = $this->helper->quoteColumnName($field);
|
||||
return new QueryFunction('LENGTH(CAST(' . $quotedName . ' as BLOB))' . $alias);
|
||||
}
|
||||
|
||||
public function charLength($field, $alias = ''): IQueryFunction {
|
||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
|
||||
$quotedName = $this->helper->quoteColumnName($field);
|
||||
return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue