From 87f03bf97e0ced5eef77b84a67d657085499ffab Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 24 Aug 2011 21:38:31 +0000 Subject: [PATCH] Allow update to be passed an empty array for the WHERE condition --- includes/db/Database.php | 2 +- includes/db/DatabaseOracle.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 279948fb37..fd1415389b 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1693,7 +1693,7 @@ abstract class DatabaseBase implements DatabaseType { $opts = $this->makeUpdateOptions( $options ); $sql = "UPDATE $opts $table SET " . $this->makeList( $values, LIST_SET ); - if ( $conds != '*' ) { + if ( $conds != '*' || ( is_array( $conds ) && count( $conds ) ) ) { $sql .= " WHERE " . $this->makeList( $conds, LIST_AND ); } diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 70f76b6ded..23e449ac7f 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -1194,7 +1194,7 @@ class DatabaseOracle extends DatabaseBase { $sql .= $sqlSet; } - if ( $conds != '*' ) { + if ( $conds != '*' || ( is_array( $conds ) && count( $conds ) ) ) { $conds = $this->wrapConditionsForWhere( $table, $conds ); $sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND ); } -- 2.20.1