r95497 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95496‎ | r95497 | r95498 >
Date:17:47, 25 August 2011
Author:reedy
Status:resolved
Tags:
Comment:
Followup r95449, fix the code to do what it was actually intended to do
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -1194,7 +1194,8 @@
11951195 $sql .= $sqlSet;
11961196 }
11971197
1198 - if ( $conds != '*' || ( is_array( $conds ) && count( $conds ) ) ) {
 1198+ if ( $conds !== array() && $conds !== '*' ) {
 1199+ if ( $conds !== array() && $conds !== '*' ) {
11991200 $conds = $this->wrapConditionsForWhere( $table, $conds );
12001201 $sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND );
12011202 }
Index: trunk/phase3/includes/db/Database.php
@@ -1693,7 +1693,7 @@
16941694 $opts = $this->makeUpdateOptions( $options );
16951695 $sql = "UPDATE $opts $table SET " . $this->makeList( $values, LIST_SET );
16961696
1697 - if ( $conds != '*' || ( is_array( $conds ) && count( $conds ) ) ) {
 1697+ if ( $conds !== array() && $conds !== '*' ) {
16981698 $sql .= " WHERE " . $this->makeList( $conds, LIST_AND );
16991699 }
17001700

Follow-up revisions

RevisionCommit summaryAuthorDate
r95498Fix fail double pasting from r95497reedy17:48, 25 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95449Allow update to be passed an empty array for the WHERE conditionreedy21:38, 24 August 2011

Status & tagging log