Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>tags/v24.0.0beta2
@@ -103,7 +103,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 { |
@@ -97,4 +97,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); | |||
} | |||
} |
@@ -54,4 +54,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); | |||
} | |||
} |