Index: branches/REL1_13/phase3/includes/BagOStuff.php |
— | — | @@ -271,12 +271,15 @@ |
272 | 272 | $exptime += time(); |
273 | 273 | $exp = $this->_fromunixtime($exptime); |
274 | 274 | } |
275 | | - $this->delete( $key ); |
| 275 | + $this->_begin(); |
| 276 | + $this->_query( |
| 277 | + "DELETE FROM $0 WHERE keyname='$1'", $key ); |
276 | 278 | $this->_doinsert($this->getTableName(), array( |
277 | 279 | 'keyname' => $key, |
278 | 280 | 'value' => $this->_blobencode($this->_serialize($value)), |
279 | 281 | 'exptime' => $exp |
280 | 282 | )); |
| 283 | + $this->_commit(); |
281 | 284 | return true; /* ? */ |
282 | 285 | } |
283 | 286 | |
— | — | @@ -284,8 +287,10 @@ |
285 | 288 | if ( $this->_readonly() ) { |
286 | 289 | return false; |
287 | 290 | } |
| 291 | + $this->_begin(); |
288 | 292 | $this->_query( |
289 | 293 | "DELETE FROM $0 WHERE keyname='$1'", $key ); |
| 294 | + $this->_commit(); |
290 | 295 | return true; /* ? */ |
291 | 296 | } |
292 | 297 | |
— | — | @@ -339,6 +344,9 @@ |
340 | 345 | |
341 | 346 | abstract function _readonly(); |
342 | 347 | |
| 348 | + function _begin() {} |
| 349 | + function _commit() {} |
| 350 | + |
343 | 351 | function _freeresult($result) { |
344 | 352 | /* stub */ |
345 | 353 | return false; |
— | — | @@ -370,7 +378,9 @@ |
371 | 379 | return false; |
372 | 380 | } |
373 | 381 | $now = $this->_fromunixtime( time() ); |
| 382 | + $this->_begin(); |
374 | 383 | $this->_query( "DELETE FROM $0 WHERE exptime < '$now'" ); |
| 384 | + $this->_commit(); |
375 | 385 | } |
376 | 386 | |
377 | 387 | function deleteall() { |
— | — | @@ -378,7 +388,9 @@ |
379 | 389 | if ( $this->_readonly() ) { |
380 | 390 | return false; |
381 | 391 | } |
| 392 | + $this->_begin(); |
382 | 393 | $this->_query( "DELETE FROM $0" ); |
| 394 | + $this->_commit(); |
383 | 395 | } |
384 | 396 | |
385 | 397 | /** |
— | — | @@ -422,13 +434,22 @@ |
423 | 435 | */ |
424 | 436 | class MediaWikiBagOStuff extends SqlBagOStuff { |
425 | 437 | var $tableInitialised = false; |
| 438 | + var $lb, $db; |
426 | 439 | |
427 | 440 | function _getDB(){ |
428 | | - static $db; |
429 | | - if( !isset( $db ) ) |
430 | | - $db = wfGetDB( DB_MASTER ); |
431 | | - return $db; |
| 441 | + if ( !isset( $this->lb ) ) { |
| 442 | + $this->lb = wfGetLBFactory()->newMainLB(); |
| 443 | + $this->db = $this->lb->getConnection( DB_MASTER ); |
| 444 | + $this->db->clearFlag( DBO_TRX ); |
| 445 | + } |
| 446 | + return $this->db; |
432 | 447 | } |
| 448 | + function _begin() { |
| 449 | + $this->_getDB()->begin(); |
| 450 | + } |
| 451 | + function _commit() { |
| 452 | + $this->_getDB()->commit(); |
| 453 | + } |
433 | 454 | function _doquery($sql) { |
434 | 455 | return $this->_getDB()->query( $sql, __METHOD__ ); |
435 | 456 | } |
Index: branches/REL1_13/phase3/RELEASE-NOTES |
— | — | @@ -3,6 +3,18 @@ |
4 | 4 | Security reminder: MediaWiki does not require PHP's register_globals |
5 | 5 | setting since version 1.2.0. If you have it on, turn it *off* if you can. |
6 | 6 | |
| 7 | +== MediaWiki 1.13.1 == |
| 8 | + |
| 9 | +September XX, 2008 |
| 10 | + |
| 11 | +This is a bugfix release of the Summer 2008 snapshot release of MediaWiki. |
| 12 | + |
| 13 | +Changes in this release: |
| 14 | + |
| 15 | +* (bug 15460) Fixed intermittent deadlock errors involving objectcache |
| 16 | + table queries. Use a separate database connection for the objectcache table |
| 17 | + to avoid long-lasting locks on that table. |
| 18 | + |
7 | 19 | == MediaWiki 1.13.0 == |
8 | 20 | |
9 | 21 | This is the first stable release of the Summer 2008 quarterly snapshot release |