Skip to content

Commit 04086c7

Browse files
committed
Merge #255 [backport25] AllConfig.php fix for v25
2 parents 56d7f01 + 0a7a13a commit 04086c7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/private/AllConfig.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,15 @@ public function getUsersForUserValue($appName, $key, $value) {
490490
$this->fixDIInit();
491491

492492
$qb = $this->connection->getQueryBuilder();
493+
$configValueColumn = $this->getSystemValue('dbtype', 'sqlite') === 'oci'
494+
? $qb->expr()->castColumn('configvalue', IQueryBuilder::PARAM_STR)
495+
: 'configvalue';
493496
$result = $qb->select('userid')
494497
->from('preferences')
495498
->where($qb->expr()->eq('appid', $qb->createNamedParameter($appName, IQueryBuilder::PARAM_STR)))
496499
->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter($key, IQueryBuilder::PARAM_STR)))
497500
->andWhere($qb->expr()->eq(
498-
$qb->expr()->castColumn('configvalue', IQueryBuilder::PARAM_STR),
501+
$configValueColumn,
499502
$qb->createNamedParameter($value, IQueryBuilder::PARAM_STR))
500503
)->orderBy('userid')
501504
->executeQuery();
@@ -524,13 +527,18 @@ public function getUsersForUserValueCaseInsensitive($appName, $key, $value) {
524527
// Email address is always stored lowercase in the database
525528
return $this->getUsersForUserValue($appName, $key, strtolower($value));
526529
}
530+
527531
$qb = $this->connection->getQueryBuilder();
532+
$configValueColumn = $this->getSystemValue('dbtype', 'sqlite') === 'oci'
533+
? $qb->expr()->castColumn('configvalue', IQueryBuilder::PARAM_STR)
534+
: 'configvalue';
535+
528536
$result = $qb->select('userid')
529537
->from('preferences')
530538
->where($qb->expr()->eq('appid', $qb->createNamedParameter($appName, IQueryBuilder::PARAM_STR)))
531539
->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter($key, IQueryBuilder::PARAM_STR)))
532540
->andWhere($qb->expr()->eq(
533-
$qb->func()->lower($qb->expr()->castColumn('configvalue', IQueryBuilder::PARAM_STR)),
541+
$qb->func()->lower($configValueColumn),
534542
$qb->createNamedParameter(strtolower($value), IQueryBuilder::PARAM_STR))
535543
)->orderBy('userid')
536544
->executeQuery();

0 commit comments

Comments
 (0)