http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70203

Revision: 70203
Author:   skizzerz
Date:     2010-07-30 19:56:49 +0000 (Fri, 30 Jul 2010)

Log Message:
-----------
* (bug 24425) Use Database::replace instead of delete/insert in 
SqlBagOStuff::set to avoid query errors about duplicate keynames.

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/BagOStuff.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-07-30 19:51:39 UTC (rev 70202)
+++ trunk/phase3/RELEASE-NOTES  2010-07-30 19:56:49 UTC (rev 70203)
@@ -258,6 +258,8 @@
   useful error message.
 * Uploading to a protected title will allow the user to choose a new name 
   instead of showing an error page
+* (bug 24425) Use Database::replace instead of delete/insert in 
SqlBagOStuff::set
+  to avoid query errors about duplicate keynames.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.

Modified: trunk/phase3/includes/BagOStuff.php
===================================================================
--- trunk/phase3/includes/BagOStuff.php 2010-07-30 19:51:39 UTC (rev 70202)
+++ trunk/phase3/includes/BagOStuff.php 2010-07-30 19:56:49 UTC (rev 70203)
@@ -307,8 +307,9 @@
                }
                try {
                        $db->begin();
-                       $db->delete( 'objectcache', array( 'keyname' => $key ), 
__METHOD__ );
-                       $db->insert( 'objectcache',
+                       // (bug 24425) use a replace if the db supports it 
instead of
+                       // delete/insert to avoid clashes with conflicting 
keynames
+                       $db->replace( 'objectcache', array( 'keyname' ),
                                array(
                                        'keyname' => $key,
                                        'value' => $db->encodeBlob( 
$this->serialize( $value ) ),



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to