Allow update to be passed an empty array for the WHERE condition
This commit is contained in:
parent
1473e98382
commit
87f03bf97e
2 changed files with 2 additions and 2 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue