From: Brad Jorsch Date: Wed, 28 Aug 2019 20:34:30 +0000 (-0400) Subject: ApiQueryCategories: Supply limit for DB query X-Git-Tag: 1.34.0-rc.0~436 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=d458953f205f20c6c3c297284a4aa584ad15faf4;p=lhc%2Fweb%2Fwiklou.git 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 --- 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__ );