diff --git a/3rdparty b/3rdparty index b72af468984ee..217764f87ec6b 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit b72af468984ee6b374ff614f2d87419fc12d0e90 +Subproject commit 217764f87ec6bbd359c76e57f0f48897d7c47646 diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 3b1c48306a678..e1f74f5327cac 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -462,9 +462,9 @@ public function setFirstResult($firstResult) { /** * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. + * Returns 0 if {@link setFirstResult} was not applied to this QueryBuilder. * - * @return integer The position of the first result. + * @return int The position of the first result. */ public function getFirstResult() { return $this->queryBuilder->getFirstResult(); diff --git a/lib/private/Repair/SqliteAutoincrement.php b/lib/private/Repair/SqliteAutoincrement.php index 9bd8fa36deba6..4a8b2a45d3f34 100644 --- a/lib/private/Repair/SqliteAutoincrement.php +++ b/lib/private/Repair/SqliteAutoincrement.php @@ -83,7 +83,7 @@ public function run(IOutput $out) { foreach ($columnNames as $columnName) { $columnSchema = $tableSchema->getColumn($columnName); $columnDiff = new ColumnDiff($columnSchema->getName(), $columnSchema); - $tableDiff->changedColumns[] = $columnDiff; + $tableDiff->changedColumns[$columnSchema->getName()] = $columnDiff; $schemaDiff->changedTables[] = $tableDiff; } } catch (SchemaException $e) { diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index e3daf4b3b465d..5d1116075d8e9 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -289,9 +289,9 @@ public function setFirstResult($firstResult); /** * Gets the position of the first result the query object was set to retrieve (the "offset"). - * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. + * Returns 0 if {@link setFirstResult} was not applied to this QueryBuilder. * - * @return integer The position of the first result. + * @return int The position of the first result. * @since 8.2.0 */ public function getFirstResult(); diff --git a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php index aef1acc40c1d9..1927850470743 100644 --- a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php @@ -102,7 +102,7 @@ protected function deleteTestingRows($appId = 'testFirstResult') { public function dataFirstResult() { return [ - [null, [99, 98, 97, 96, 95, 94, 93, 92, 91]], + [0, [99, 98, 97, 96, 95, 94, 93, 92, 91]], [0, [99, 98, 97, 96, 95, 94, 93, 92, 91]], [1, [98, 97, 96, 95, 94, 93, 92, 91]], [5, [94, 93, 92, 91]], @@ -112,7 +112,7 @@ public function dataFirstResult() { /** * @dataProvider dataFirstResult * - * @param int $firstResult + * @param int|null $firstResult * @param array $expectedSet */ public function testFirstResult($firstResult, $expectedSet) { @@ -121,14 +121,10 @@ public function testFirstResult($firstResult, $expectedSet) { if ($firstResult !== null) { $this->queryBuilder->setFirstResult($firstResult); - - // FIXME Remove this once Doctrine/DBAL is >2.5.1: - // FIXME See https://github.com/doctrine/dbal/pull/782 - $this->queryBuilder->setMaxResults(100); } $this->assertSame( - $firstResult, + $firstResult ?? 0, $this->queryBuilder->getFirstResult() );