Use OCTET_LENGTH which is more common than LENGTHB

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-03-24 17:22:41 +01:00
parent 3a61963980
commit 6e3cd43903
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 7 additions and 1 deletions

View file

@ -82,7 +82,7 @@ class FunctionBuilder implements IFunctionBuilder {
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('OCTET_LENGTH(' . $quotedName . ')' . $alias);
}
public function charLength($field, $alias = ''): IQueryFunction {

View file

@ -72,4 +72,10 @@ class OCIFunctionBuilder extends FunctionBuilder {
return parent::least($x, $y);
}
public function octetLength($field, $alias = ''): IQueryFunction {
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : '';
$quotedName = $this->helper->quoteColumnName($field);
return new QueryFunction('LENGTHB(' . $quotedName . ')' . $alias);
}
}