From: Aaron Schulz Date: Wed, 25 Feb 2009 04:33:44 +0000 (+0000) Subject: INDEX use fixes X-Git-Tag: 1.31.0-rc.0~42688 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=f0566ab4b6959839f35d9da3bf7760b0ab5c6221;p=lhc%2Fweb%2Fwiklou.git INDEX use fixes --- diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 5d491fc1ba..33c5cb5485 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -94,8 +94,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $limit = $params['limit']; $this->addOption('LIMIT', $limit +1); - - $index = false; + $user = $params['user']; if (!is_null($user)) { $userid = User::idFromName($user); @@ -114,7 +113,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->addWhereFld('log_title', $titleObj->getDBkey()); // Use the title index in preference to the user index if there is a conflict - $index = 'page_time'; + $index = is_null($user) ? 'page_time' : array('page_time','user_time'); } if ( $index ) { $this->addOption( 'USE INDEX', array( 'logging' => $index ) );