r60830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60829‎ | r60830 | r60831 >
Date:07:23, 8 January 2010
Author:freakolowsky
Status:ok
Tags:
Comment:
Prevented delete call in replace function if conditions empty. Removed some old commented code.
Modified paths:
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -700,35 +700,9 @@
701701 $condsDelete = array();
702702 foreach ( $uniqueIndexes as $index )
703703 $condsDelete[$index] = $row[$index];
704 - $this->delete( $table, $condsDelete, $fname );
705 -/*
706 - $sql = "DELETE FROM $table WHERE ";
707 - $first = true;
708 - foreach ( $uniqueIndexes as $index ) {
709 - if ( $first ) {
710 - $first = false;
711 - $sql .= "(";
712 - } else {
713 - $sql .= ') OR (';
714 - }
715 - if ( is_array( $index ) ) {
716 - $first2 = true;
717 - foreach ( $index as $col ) {
718 - if ( $first2 ) {
719 - $first2 = false;
720 - } else {
721 - $sql .= ' AND ';
722 - }
723 - $sql .= $col.'=' . $this->addQuotes( $row[$col] );
724 - }
725 - } else {
726 - $sql .= $index.'=' . $this->addQuotes( $row[$index] );
727 - }
 704+ if (count($condsDelete) > 0) {
 705+ $this->delete( $table, $condsDelete, $fname );
728706 }
729 - $sql .= ')';
730 -
731 - $this->doQuery( $sql);//, $fname );
732 -*/
733707 }
734708
735709 if ( $sequenceData !== false && !isset( $row[$sequenceData['column']] ) ) {

Status & tagging log