This essential feature was broken 3 years ago, in r78786. The group
connection was being used only for a call to the archaic
Database::fetchObject().
Change-Id: Ia4c76c88ecc77eb663a535b0625a1509882a35c7
$fname = get_class( $this ) . '::recache';
$dbw = wfGetDB( DB_MASTER );
$fname = get_class( $this ) . '::recache';
$dbw = wfGetDB( DB_MASTER );
- $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), __METHOD__, 'vslow' ) );
- if ( !$dbw || !$dbr ) {
$num = $res->numRows();
# Fetch results
$vals = array();
$num = $res->numRows();
# Fetch results
$vals = array();
- while ( $res && $row = $dbr->fetchObject( $res ) ) {
+ foreach ( $res as $row ) {
if ( isset( $row->value ) ) {
if ( $this->usesTimestamps() ) {
$value = wfTimestamp( TS_UNIX,
if ( isset( $row->value ) ) {
if ( $this->usesTimestamps() ) {
$value = wfTimestamp( TS_UNIX,
+ /**
+ * Get a DB connection to be used for slow recache queries
+ */
+ function getRecacheDB() {
+ return wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) );
+ }
+
/**
* Run the query and return the result
* @param int|bool $limit Numerical limit or false for no limit
/**
* Run the query and return the result
* @param int|bool $limit Numerical limit or false for no limit
*/
function reallyDoQuery( $limit, $offset = false ) {
$fname = get_class( $this ) . "::reallyDoQuery";
*/
function reallyDoQuery( $limit, $offset = false ) {
$fname = get_class( $this ) . "::reallyDoQuery";
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = $this->getRecacheDB();
$query = $this->getQueryInfo();
$order = $this->getOrderFields();
$query = $this->getQueryInfo();
$order = $this->getOrderFields();