Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion apps/user_ldap/lib/Mapping/AbstractMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@ protected function collectResultsFromListOfIdsQuery(IQueryBuilder $qb, array &$r
public function getListOfIdsByDn(array $fdns): array {
$totalDBParamLimit = 65000;
$sliceSize = 1000;
$maxSlices = $this->dbc->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE ? 9 : $totalDBParamLimit / $sliceSize;
// SQLite's variable limit is very low; Oracle's OCI8 driver has high per-bind overhead,
// making large parameter lists (65k) extremely slow — use smaller batches for both.
$maxSlices = match ($this->dbc->getDatabaseProvider()) {
IDBConnection::PLATFORM_SQLITE => 9,
IDBConnection::PLATFORM_ORACLE => 5,
default => $totalDBParamLimit / $sliceSize,
};
$results = [];

$slice = 1;
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function testGetListOfIdsByDn(): void {
[$mapper,] = $this->initTest();

$listOfDNs = [];
// List size exceeds the implementation's 65000-parameter chunk limit, forcing multiple chunked queries
// List size exceeds any single-query chunk limit (65k for most DBs, 9k for SQLite, 5k for Oracle), forcing multiple chunked queries
for ($i = 0; $i < 66640; $i++) {
$name = 'as_' . $i;
$dn = 'uid=' . $name . ',dc=example,dc=org';
Expand Down
Loading