Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use getLengthExpression to measure field length instead of like
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Dec 19, 2022
commit 774bb066d97189a719f64c0d51eeffd187613fdd
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ protected function handleIDs(string $table, bool $emitHooks) {

protected function getSelectQuery(string $table): IQueryBuilder {
$qb = $this->dbc->getQueryBuilder();
$lengthExpr = $this->dbc->getDatabasePlatform()->getLengthExpression('owncloud_name');
$qb->select('owncloud_name', 'directory_uuid')
->from($table)
->where($qb->expr()->like('owncloud_name', $qb->createNamedParameter(str_repeat('_', 65) . '%'), Types::STRING));
->where($qb->expr()->gt($qb->createFunction($lengthExpr), '64', IQueryBuilder::PARAM_INT));
return $qb;
}

Expand Down