r104926 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104925‎ | r104926 | r104927 >
Date:00:29, 2 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Reverting r103706

Only seemingly supported by MySQL, and likely a seldom used function

Not worth trying to support it, as other non mysql db's would need workarounds, and that's just not happening
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -1197,11 +1197,7 @@
11981198 function update( $table, $values, $conds, $fname = 'DatabaseOracle::update', $options = array() ) {
11991199 global $wgContLang;
12001200
1201 - if ( is_array( $table ) ) {
1202 - $table = implode( ',', array_map( array( $this, 'tableName' ), $table ) );
1203 - } else {
1204 - $table = $this->tableName( $table );
1205 - }
 1201+ $table = $this->tableName( $table );
12061202 $opts = $this->makeUpdateOptions( $options );
12071203 $sql = "UPDATE $opts $table SET ";
12081204
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -984,11 +984,7 @@
985985 public function update( $table, $values, $conds, $fname = 'DatabaseIbm_db2::update',
986986 $options = array() )
987987 {
988 - if ( is_array( $table ) ) {
989 - $table = implode( ',', array_map( array( $this, 'tableName' ), $table ) );
990 - } else {
991 - $table = $this->tableName( $table );
992 - }
 988+ $table = $this->tableName( $table );
993989 $opts = $this->makeUpdateOptions( $options );
994990 $sql = "UPDATE $opts $table SET "
995991 . $this->makeList( $values, LIST_SET_PREPARED );
Index: trunk/phase3/includes/db/Database.php
@@ -1697,32 +1697,28 @@
16981698 /**
16991699 * UPDATE wrapper. Takes a condition array and a SET array.
17001700 *
1701 - * @param $table String|array name of the table to UPDATE. This will be passed through
 1701+ * @param $table String name of the table to UPDATE. This will be passed through
17021702 * DatabaseBase::tableName().
17031703 *
1704 - * @param $values Array An array of values to SET. For each array element,
 1704+ * @param $values Array: An array of values to SET. For each array element,
17051705 * the key gives the field name, and the value gives the data
17061706 * to set that field to. The data will be quoted by
17071707 * DatabaseBase::addQuotes().
17081708 *
1709 - * @param $conds Array An array of conditions (WHERE). See
 1709+ * @param $conds Array: An array of conditions (WHERE). See
17101710 * DatabaseBase::select() for the details of the format of
17111711 * condition arrays. Use '*' to update all rows.
17121712 *
1713 - * @param $fname String The function name of the caller (from __METHOD__),
 1713+ * @param $fname String: The function name of the caller (from __METHOD__),
17141714 * for logging and profiling.
17151715 *
1716 - * @param $options Array An array of UPDATE options, can be:
 1716+ * @param $options Array: An array of UPDATE options, can be:
17171717 * - IGNORE: Ignore unique key conflicts
17181718 * - LOW_PRIORITY: MySQL-specific, see MySQL manual.
17191719 * @return Boolean
17201720 */
17211721 function update( $table, $values, $conds, $fname = 'DatabaseBase::update', $options = array() ) {
1722 - if ( is_array( $table ) ) {
1723 - $table = implode( ',', array_map( array( $this, 'tableName' ), $table ) );
1724 - } else {
1725 - $table = $this->tableName( $table );
1726 - }
 1722+ $table = $this->tableName( $table );
17271723 $opts = $this->makeUpdateOptions( $options );
17281724 $sql = "UPDATE $opts $table SET " . $this->makeList( $values, LIST_SET );
17291725

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103706* (bug 8859) Database::update should take array of tables too...reedy20:17, 19 November 2011

Status & tagging log