- $this->beginTransaction( $db, __METHOD__ );
- # Go through and update rev_len from these rows.
- foreach ( $res as $row ) {
- if ( $this->upgradeRow( $row, $table, $idCol, $prefix ) ) {
- $count++;
+ if ( $res->numRows() > 0 ) {
+ $this->beginTransaction( $dbw, __METHOD__ );
+ # Go through and update rev_len from these rows.
+ foreach ( $res as $row ) {
+ if ( $this->upgradeRow( $row, $table, $idCol, $prefix ) ) {
+ $count++;
+ }