* This covers the case with a snapshotted transaction outside of lock()/unlock()
Change-Id: I8639c2e51cb918f452dc1576681d6224fb4fb2c0
}
if ( $timestamp === false ) {
+ // Use FOR UPDATE in case lock()/unlock() did not start the transaction
$ltimestamp = $dbw->selectField( 'image', 'img_timestamp',
- array( 'img_name' => $this->getName() ), __METHOD__ );
+ array( 'img_name' => $this->getName() ), __METHOD__, array( 'FOR UPDATE' ) );
$ltime = $ltimestamp ? wfTimestamp( TS_UNIX, $ltimestamp ) : false;
$ctime = time();
// Avoid a timestamp that is not newer than the last version