Use IDatabase::buildComparison in MigrateActorsAF

Avoid IDatabase::addQuotes

Change-Id: I68712c407cec15eb7fac0303ad7fa94651f4e0be
This commit is contained in:
Umherirrender 2024-07-16 23:35:21 +02:00
parent 6b326ff2e0
commit 73a15cdcbf

View file

@ -76,19 +76,14 @@ class MigrateActorsAF extends LoggedUpdateMaintenance {
* @return array [ string $next, string $display ]
*/
private function makeNextCond( $dbw, $primaryKey, $row ) {
$next = '';
$conditions = [];
$display = [];
for ( $i = count( $primaryKey ) - 1; $i >= 0; $i-- ) {
$field = $primaryKey[$i];
foreach ( $primaryKey as $field ) {
$display[] = $field . '=' . $row->$field;
$value = $dbw->addQuotes( $row->$field );
if ( $next === '' ) {
$next = "$field > $value";
} else {
$next = "$field > $value OR $field = $value AND ($next)";
}
$conditions[$field] = $row->$field;
}
$display = implode( ' ', array_reverse( $display ) );
$next = $dbw->buildComparison( '>', $conditions );
$display = implode( ' ', $display );
return [ $next, $display ];
}