diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-01-07 19:43:21 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-01-07 20:16:40 +0100 |
commit | 6eca8d6ae158e613547b7eba1f0dda141a008ee0 (patch) | |
tree | f033658adcc1a8e776d7228766f9d6472edf3152 /apps/user_ldap/tests | |
parent | 82947263b90bb350501024da58809e7223fc4087 (diff) | |
download | nextcloud-server-6eca8d6ae158e613547b7eba1f0dda141a008ee0.tar.gz nextcloud-server-6eca8d6ae158e613547b7eba1f0dda141a008ee0.zip |
respect DB limits of arguments in a IN list
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r-- | apps/user_ldap/tests/Mapping/AbstractMappingTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php index 079c2e21b10..dd322d58a8e 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php @@ -281,4 +281,23 @@ abstract class AbstractMappingTest extends \Test\TestCase { $results = $mapper->getList(1, 1); $this->assertSame(1, count($results)); } + + public function testGetListOfIdsByDn() { + /** @var AbstractMapping $mapper */ + list($mapper,) = $this->initTest(); + + $listOfDNs = []; + for ($i = 0; $i < 65640; $i++) { + // Postgres has a limit of 65535 values in a single IN list + $name = 'as_' . $i; + $dn = 'uid=' . $name . ',dc=example,dc=org'; + $listOfDNs[] = $dn; + if ($i % 20 === 0) { + $mapper->map($dn, $name, 'fake-uuid-' . $i); + } + } + + $result = $mapper->getListOfIdsByDn($listOfDNs); + $this->assertSame(65640 / 20, count($result)); + } } |