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 authored and backportbot-nextcloud[bot] committed Dec 13, 2022
commit 884ea3e87007267b23b40b5f178e088c34cbbbd4
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