X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUserContributions.php;h=f92a916f6cbcea564ad42fcf6c2a6e97e4c893b4;hb=76d62d7b204b48a0794032d2266ed64455058d13;hp=60e91e80ec886559ca8c7a7cf421fe7d396209d1;hpb=fd9559cb4da5582565eba6216e828efb2cde8db8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 60e91e80ec..f92a916f6c 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -57,13 +57,13 @@ class ApiQueryContributions extends ApiQueryBase { $this->fld_patrolled = isset( $prop['patrolled'] ); $this->fld_tags = isset( $prop['tags'] ); - // Most of this code will use the 'contributions' group DB, which can map to slaves + // Most of this code will use the 'contributions' group DB, which can map to replica DBs // with extra user based indexes or partioning by user. The additional metadata - // queries should use a regular slave since the lookup pattern is not all by user. - $dbSecondary = $this->getDB(); // any random slave + // queries should use a regular replica DB since the lookup pattern is not all by user. + $dbSecondary = $this->getDB(); // any random replica DB // TODO: if the query is going only against the revision table, should this be done? - $this->selectNamedDB( 'contributions', DB_SLAVE, 'contributions' ); + $this->selectNamedDB( 'contributions', DB_REPLICA, 'contributions' ); $this->idMode = false; if ( isset( $this->params['userprefix'] ) ) { @@ -337,7 +337,9 @@ class ApiQueryContributions extends ApiQueryBase { $this->addWhereFld( 'ct_tag', $this->params['tag'] ); } - $this->addOption( 'USE INDEX', $index ); + if ( isset( $index ) ) { + $this->addOption( 'USE INDEX', $index ); + } } /**