diff --git a/src/Processor/Processor.php b/src/Processor/Processor.php index 885f2279..f6c50343 100644 --- a/src/Processor/Processor.php +++ b/src/Processor/Processor.php @@ -125,7 +125,7 @@ protected static function applyLimit(?LimitClause $limit, Scope $scope, QueryRes } return new QueryResult( - \array_slice($result->rows, $offset, $rowcount, true), + \array_slice($result->rows, $offset, $rowcount), $result->columns ); } diff --git a/tests/EndToEndTest.php b/tests/EndToEndTest.php index b3ccc72e..45192f99 100644 --- a/tests/EndToEndTest.php +++ b/tests/EndToEndTest.php @@ -805,6 +805,18 @@ public function testSelectHavingOnAliasField() ); } + public function testSelectWithOffset() + { + $pdo = self::getConnectionToFullDB(false); + $query = $pdo->prepare("SELECT `id` FROM `video_game_characters` ORDER BY `id` LIMIT 10000 OFFSET 1"); + $query->execute(); + + $this->assertSame( + ['id' => 2], + $query->fetch(\PDO::FETCH_ASSOC) + ); + } + public function testLastInsertIdAfterSkippingAutoincrement() { $pdo = self::getConnectionToFullDB(false);