Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-24 13:12:12 +0300
committerVincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com>2022-03-24 23:35:02 +0300
commit7dc3eb1e9e9a2cf6b52dc17986b4bbca395f0998 (patch)
tree4c3d21f90d7caa4aca1a7c1abb7d4d7444c34dec /apps/user_ldap
parenta7e778b57fb81c8e62d093ece7f0689d34db4c45 (diff)
Use getLengthExpression to measure field length instead of like
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Migration/Version1120Date20210917155206.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php b/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php
index d2b440c4dfe..87a8f07fbe1 100644
--- a/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php
+++ b/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php
@@ -127,9 +127,10 @@ class Version1120Date20210917155206 extends SimpleMigrationStep {
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;
}