diff options
author | Aaron Schulz <aschulz@wikimedia.org> | 2014-10-18 19:47:22 -0700 |
---|---|---|
committer | Springle <springle@wikimedia.org> | 2014-10-29 06:59:51 +0000 |
commit | 17cc78767ab099f9d00d267f230be81c202b1795 (patch) | |
tree | 540d5d2775f4be32c3787d19ae5d8cc97c4b9373 /includes | |
parent | d4c77064a2e580eddbfa78222d10bc9e95fda8b4 (diff) | |
download | mediawikicore-17cc78767ab099f9d00d267f230be81c202b1795.tar.gz mediawikicore-17cc78767ab099f9d00d267f230be81c202b1795.zip |
Switch to LOCK IN SHARE MODE in recordUpload2()
* We just need the latest data; the advisory locking in lock()
already manages mutual exclusion.
Change-Id: I9af7a892b2dcafd30149332b0084f61d117c9cad
Diffstat (limited to 'includes')
-rw-r--r-- | includes/filerepo/file/LocalFile.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 08c9afb18e2b..9f1466955ae2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1303,9 +1303,11 @@ class LocalFile extends File { ); if ( $dbw->affectedRows() == 0 ) { if ( $allowTimeKludge ) { - # Use FOR UPDATE to ignore any transaction snapshotting + # Use LOCK IN SHARE MODE to ignore any transaction snapshotting $ltimestamp = $dbw->selectField( 'image', 'img_timestamp', - array( 'img_name' => $this->getName() ), __METHOD__, array( 'FOR UPDATE' ) ); + array( 'img_name' => $this->getName() ), + __METHOD__, + array( 'LOCK IN SHARE MODE' ) ); $lUnixtime = $ltimestamp ? wfTimestamp( TS_UNIX, $ltimestamp ) : false; # Avoid a timestamp that is not newer than the last version # TODO: the image/oldimage tables should be like page/revision with an ID field |