* (bug 14638) Special:Blockip now provides a link to the block log if the user
has been blocked more than 10 times. Patch by Matt Johnston.
* (bug 12678) Skins don't show Upload link if the user isn't allowed to upload.
+* Fixed incorrect usage of DB_LAST in Special:Export. Deprecated DB_LAST.
=== API changes in 1.14 ===
* will always return the same object, unless the underlying connection or load
* balancer is manually destroyed.
*/
-function &wfGetDB( $db = DB_LAST, $groups = array(), $wiki = false ) {
+function &wfGetDB( $db, $groups = array(), $wiki = false ) {
return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki );
}
/* private */ var $mServers, $mConns, $mLoads, $mGroupLoads;
/* private */ var $mFailFunction, $mErrorConnection;
- /* private */ var $mReadIndex, $mLastIndex, $mAllowLagged;
+ /* private */ var $mReadIndex, $mAllowLagged;
/* private */ var $mWaitForPos, $mWaitTimeout;
/* private */ var $mLaggedSlaveMode, $mLastError = 'Unknown error';
/* private */ var $mParentInfo, $mLagTimes;
'local' => array(),
'foreignUsed' => array(),
'foreignFree' => array() );
- $this->mLastIndex = -1;
$this->mLoads = array();
$this->mWaitForPos = false;
$this->mLaggedSlaveMode = false;
if ( $i == DB_SLAVE ) {
$i = $this->getReaderIndex( false, $wiki, $attempts );
} elseif ( $i == DB_LAST ) {
- # Just use $this->mLastIndex, which should already be set
- $i = $this->mLastIndex;
- if ( $i === -1 ) {
- # Oh dear, not set, best to use the writer for safety
- wfDebug( "Warning: DB_LAST used when there was no previous index\n" );
- $i = $this->getWriterIndex();
- }
+ throw new MWException( 'Attempt to call ' . __METHOD__ . ' with deprecated server index DB_LAST' );
}
# Couldn't find a working server in getReaderIndex()?
if ( $i === false ) {
$conn = false;
}
}
- $this->mLastIndex = $i;
wfProfileOut( __METHOD__ );
return $conn;
}
} else {
// Use an unbuffered query; histories may be very long!
$lb = wfGetLBFactory()->newMainLB();
- $db = $lb->getConnection( DB_LAST );
+ $db = $lb->getConnection( DB_SLAVE );
$buffer = WikiExporter::STREAM;
// This might take a while... :D