mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
fix: fix oci string length with empty strings
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
8380ae11e7
commit
05ef7132dc
1 changed files with 2 additions and 2 deletions
|
|
@ -81,12 +81,12 @@ class OCIFunctionBuilder extends FunctionBuilder {
|
|||
public function octetLength($field, $alias = ''): IQueryFunction {
|
||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
|
||||
$quotedName = $this->helper->quoteColumnName($field);
|
||||
return new QueryFunction('LENGTHB(' . $quotedName . ')' . $alias);
|
||||
return new QueryFunction('COALESCE(LENGTHB(' . $quotedName . '), 0)' . $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);
|
||||
return new QueryFunction('COALESCE(LENGTH(' . $quotedName . '), 0)' . $alias);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue