diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-24 17:22:41 +0100 |
---|---|---|
committer | Vincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com> | 2022-03-24 20:35:02 +0000 |
commit | 25af856ed26d0a4ef542b9d621b5e3512198ad99 (patch) | |
tree | 58450232cf407553788237fba7a688c7a4ec18ce /lib | |
parent | bfd09a0669ff4c87218fdeea33b0cd464692b805 (diff) | |
download | nextcloud-server-25af856ed26d0a4ef542b9d621b5e3512198ad99.tar.gz nextcloud-server-25af856ed26d0a4ef542b9d621b5e3512198ad99.zip |
Use OCTET_LENGTH which is more common than LENGTHB
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php | 2 | ||||
-rw-r--r-- | lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php index c0f07d37406..e121374a763 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/FunctionBuilder.php @@ -97,7 +97,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 { diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php index 43ecf599eba..1a9eae3c21f 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php @@ -91,4 +91,10 @@ class OCIFunctionBuilder extends FunctionBuilder { $separator = $this->connection->quote($separator); return new QueryFunction('LISTAGG(' . $this->helper->quoteColumnName($expr) . ', ' . $separator . ')' . $orderByClause); } + + public function octetLength($field, $alias = ''): IQueryFunction { + $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; + $quotedName = $this->helper->quoteColumnName($field); + return new QueryFunction('LENGTHB(' . $quotedName . ')' . $alias); + } } |