r92423 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92422‎ | r92423 | r92424 >
Date:09:07, 18 July 2011
Author:freakolowsky
Status:ok
Tags:
Comment:
* fixed replace function ... some issues in ResourceLoader code
this problem does not exist in trunk because replace function got
generalized by Tim
Modified paths:
  • /branches/REL1_17/phase3/includes/db/DatabaseOracle.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/db/DatabaseOracle.php
@@ -775,13 +775,20 @@
776776 foreach ( $rows as $row ) {
777777 # Delete rows which collide
778778 if ( $uniqueIndexes ) {
779 - $condsDelete = array();
780 - foreach ( $uniqueIndexes as $index ) {
781 - $condsDelete[$index] = $row[$index];
 779+ $deleteConds = array();
 780+ foreach ( $uniqueIndexes as $key=>$index ) {
 781+ if ( is_array( $index ) ) {
 782+ $deleteConds2 = array();
 783+ foreach ( $index as $col ) {
 784+ $deleteConds2[$col] = $row[$col];
 785+ }
 786+ $deleteConds[$key] = $this->makeList( $deleteConds2, LIST_AND );
 787+ } else {
 788+ $deleteConds[$index] = $row[$index];
 789+ }
782790 }
783 - if ( count( $condsDelete ) > 0 ) {
784 - $this->delete( $table, $condsDelete, $fname );
785 - }
 791+ $deleteConds = array( $this->makeList( $deleteConds, LIST_OR ) );
 792+ $this->delete( $table, $deleteConds, $fname );
786793 }
787794
788795 if ( $sequenceData !== false && !isset( $row[$sequenceData['column']] ) ) {

Status & tagging log