From d458953f205f20c6c3c297284a4aa584ad15faf4 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 28 Aug 2019 16:34:30 -0400 Subject: [PATCH] ApiQueryCategories: Supply limit for DB query The limit is applied in PHP, but all matching rows are being fetched from the database. We should only fetch the number of rows needed. Bug: T231462 Change-Id: Ie64ea6f79a187942c476868c383a1349d110aa7c --- includes/api/ApiQueryCategories.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index 547a4e89db..79347e625a 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -127,6 +127,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { 'cl_to' . $sort ] ); } + $this->addOption( 'LIMIT', $params['limit'] + 1 ); $res = $this->select( __METHOD__ ); -- 2.20.1