when wikibits.js was moved up before user JS inclusion.
* Added $wgColorErrors: if set, database error messages will be highlighted
when running command-line scripts in a Unix terminal.
+* (bug 5195) rebuildrecentchanges.php works again; Database::insertSelect now
+ has a parameter for select options.
=== Caveats ===
* srcTable may be an array of tables.
*/
function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'Database::insertSelect',
- $options = array() )
+ $insertOptions = array(), $selectOptions = array() )
{
$destTable = $this->tableName( $destTable );
- if ( is_array( $options ) ) {
- $options = implode( ' ', $options );
+ if ( is_array( $insertOptions ) ) {
+ $insertOptions = implode( ' ', $insertOptions );
}
+ if( !is_array( $selectOptions ) ) {
+ $selectOptions = array( $selectOptions );
+ }
+ list( $useIndex, $tailOpts ) = $this->makeSelectOptions( $selectOptions );
if( is_array( $srcTable ) ) {
$srcTable = implode( ',', array_map( array( &$this, 'tableName' ), $srcTable ) );
} else {
$srcTable = $this->tableName( $srcTable );
}
- $sql = "INSERT $options INTO $destTable (" . implode( ',', array_keys( $varMap ) ) . ')' .
+ $sql = "INSERT $insertOptions INTO $destTable (" . implode( ',', array_keys( $varMap ) ) . ')' .
' SELECT ' . implode( ',', $varMap ) .
- " FROM $srcTable";
+ " FROM $srcTable $useIndex ";
if ( $conds != '*' ) {
$sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND );
}
+ $sql .= " $tailOpts";
return $this->query( $sql, $fname );
}
'rc_last_oldid' => 0, // is this ok?
'rc_type' => $dbw->conditional( 'page_is_new != 0', RC_NEW, RC_EDIT ),
), array(
- 'rev_timestamp > ' . $dbw->timestamp( $cutoff ),
+ 'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $cutoff ) ),
'rev_page=page_id'
- ), $fname, array( 'ORDER BY' => 'rev_timestamp', 'LIMIT' => 5000 )
+ ), $fname,
+ array(), // INSERT options
+ array( 'ORDER BY' => 'rev_timestamp', 'LIMIT' => 5000 ) // SELECT options
);
}