Skip to content

Commit

Permalink
fixup! fix: Only apply cast if needed when searching users for value
Browse files Browse the repository at this point in the history
  • Loading branch information
juliushaertl committed Nov 30, 2023
1 parent 6564c25 commit 381db45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/private/AllConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/
namespace OC;

use Doctrine\DBAL\Platforms\OraclePlatform;
use OCP\Cache\CappedMemoryCache;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IConfig;
Expand Down Expand Up @@ -490,7 +491,7 @@ public function getUsersForUserValue($appName, $key, $value) {
$this->fixDIInit();

$qb = $this->connection->getQueryBuilder();
$configValueColumn = $this->getSystemValue('dbtype', 'sqlite') === 'oci'
$configValueColumn = ($this->connection->getDatabasePlatform() instanceof OraclePlatform)
? $qb->expr()->castColumn('configvalue', IQueryBuilder::PARAM_STR)
: 'configvalue';
$result = $qb->select('userid')
Expand Down Expand Up @@ -529,7 +530,7 @@ public function getUsersForUserValueCaseInsensitive($appName, $key, $value) {
}

$qb = $this->connection->getQueryBuilder();
$configValueColumn = $this->getSystemValue('dbtype', 'sqlite') === 'oci'
$configValueColumn = ($this->connection->getDatabasePlatform() instanceof OraclePlatform)
? $qb->expr()->castColumn('configvalue', IQueryBuilder::PARAM_STR)
: 'configvalue';

Expand Down

0 comments on commit 381db45

Please sign in to comment.