Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2644,7 +2644,7 @@ |
2645 | 2645 | * will always return the same object, unless the underlying connection or load |
2646 | 2646 | * balancer is manually destroyed. |
2647 | 2647 | */ |
2648 | | -function &wfGetDB( $db = DB_LAST, $groups = array(), $wiki = false ) { |
| 2648 | +function &wfGetDB( $db, $groups = array(), $wiki = false ) { |
2649 | 2649 | return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki ); |
2650 | 2650 | } |
2651 | 2651 | |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -372,7 +372,7 @@ |
373 | 373 | if ( !$error ) { |
374 | 374 | $error = $phpError; |
375 | 375 | } |
376 | | - wfLogDBError( "Connection error: $error\n" ); |
| 376 | + wfLogDBError( "Error connecting to {$this->mServer}: $error\n" ); |
377 | 377 | } |
378 | 378 | |
379 | 379 | wfProfileOut("dbconnect-$server"); |
Index: trunk/phase3/includes/db/LoadBalancer.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | |
17 | 17 | /* private */ var $mServers, $mConns, $mLoads, $mGroupLoads; |
18 | 18 | /* private */ var $mFailFunction, $mErrorConnection; |
19 | | - /* private */ var $mReadIndex, $mLastIndex, $mAllowLagged; |
| 19 | + /* private */ var $mReadIndex, $mAllowLagged; |
20 | 20 | /* private */ var $mWaitForPos, $mWaitTimeout; |
21 | 21 | /* private */ var $mLaggedSlaveMode, $mLastError = 'Unknown error'; |
22 | 22 | /* private */ var $mParentInfo, $mLagTimes; |
— | — | @@ -52,7 +52,6 @@ |
53 | 53 | 'local' => array(), |
54 | 54 | 'foreignUsed' => array(), |
55 | 55 | 'foreignFree' => array() ); |
56 | | - $this->mLastIndex = -1; |
57 | 56 | $this->mLoads = array(); |
58 | 57 | $this->mWaitForPos = false; |
59 | 58 | $this->mLaggedSlaveMode = false; |
— | — | @@ -441,13 +440,7 @@ |
442 | 441 | if ( $i == DB_SLAVE ) { |
443 | 442 | $i = $this->getReaderIndex( false, $wiki, $attempts ); |
444 | 443 | } elseif ( $i == DB_LAST ) { |
445 | | - # Just use $this->mLastIndex, which should already be set |
446 | | - $i = $this->mLastIndex; |
447 | | - if ( $i === -1 ) { |
448 | | - # Oh dear, not set, best to use the writer for safety |
449 | | - wfDebug( "Warning: DB_LAST used when there was no previous index\n" ); |
450 | | - $i = $this->getWriterIndex(); |
451 | | - } |
| 444 | + throw new MWException( 'Attempt to call ' . __METHOD__ . ' with deprecated server index DB_LAST' ); |
452 | 445 | } |
453 | 446 | # Couldn't find a working server in getReaderIndex()? |
454 | 447 | if ( $i === false ) { |
— | — | @@ -545,7 +538,6 @@ |
546 | 539 | $conn = false; |
547 | 540 | } |
548 | 541 | } |
549 | | - $this->mLastIndex = $i; |
550 | 542 | wfProfileOut( __METHOD__ ); |
551 | 543 | return $conn; |
552 | 544 | } |
Index: trunk/phase3/includes/specials/SpecialExport.php |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | } else { |
232 | 232 | // Use an unbuffered query; histories may be very long! |
233 | 233 | $lb = wfGetLBFactory()->newMainLB(); |
234 | | - $db = $lb->getConnection( DB_LAST ); |
| 234 | + $db = $lb->getConnection( DB_SLAVE ); |
235 | 235 | $buffer = WikiExporter::STREAM; |
236 | 236 | |
237 | 237 | // This might take a while... :D |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -212,6 +212,7 @@ |
213 | 213 | * (bug 14638) Special:Blockip now provides a link to the block log if the user |
214 | 214 | has been blocked more than 10 times. Patch by Matt Johnston. |
215 | 215 | * (bug 12678) Skins don't show Upload link if the user isn't allowed to upload. |
| 216 | +* Fixed incorrect usage of DB_LAST in Special:Export. Deprecated DB_LAST. |
216 | 217 | |
217 | 218 | === API changes in 1.14 === |
218 | 219 | |