From: Aaron Schulz Date: Mon, 8 Feb 2016 21:41:57 +0000 (-0800) Subject: Avoid master queries in Title::getLinksFrom() X-Git-Tag: 1.31.0-rc.0~7919^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=6ce91360c0147e9071965dbf8b1067e8b7c7f6c7;p=lhc%2Fweb%2Fwiklou.git Avoid master queries in Title::getLinksFrom() All callers only hit this case by accident (e.g. limit/offset) Bug: T92357 Change-Id: I4b5d1b62b2e564b40c65c82cfd4788093d61fc98 --- diff --git a/includes/Title.php b/includes/Title.php index 55c7179276..a962ea6415 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3427,7 +3427,7 @@ class Title implements LinkTarget { * WARNING: do not use this function on arbitrary user-supplied titles! * On heavily-used templates it will max out the memory. * - * @param array $options May be FOR UPDATE + * @param array $options Query option to Database::select() * @return Title[] Array of Title the Title objects linking here */ public function getTemplateLinksTo( $options = array() ) { @@ -3441,7 +3441,7 @@ class Title implements LinkTarget { * WARNING: do not use this function on arbitrary user-supplied titles! * On heavily-used templates it will max out the memory. * - * @param array $options May be FOR UPDATE + * @param array $options Query option to Database::select() * @param string $table Table name * @param string $prefix Fields prefix * @return array Array of Title objects linking here @@ -3454,11 +3454,7 @@ class Title implements LinkTarget { return array(); } - if ( count( $options ) > 0 ) { - $db = wfGetDB( DB_MASTER ); - } else { - $db = wfGetDB( DB_SLAVE ); - } + $db = wfGetDB( DB_SLAVE ); $blNamespace = "{$prefix}_namespace"; $blTitle = "{$prefix}_title";