From: Aaron Schulz Date: Tue, 20 Mar 2012 00:57:18 +0000 (+0000) Subject: [FileRepo] Added long-since missing FOR UPDATE to LocalFile::lock(). This might help... X-Git-Tag: 1.31.0-rc.0~24183 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=7770391b3044f4271269b5e7114bd0719a69920a;p=lhc%2Fweb%2Fwiklou.git [FileRepo] Added long-since missing FOR UPDATE to LocalFile::lock(). This might help with the weird mismatched metadata for files with two uploads at the same time that I keep seeing in the DB. --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 27c412f545..9731efcc6b 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1444,7 +1444,8 @@ class LocalFile extends File { $this->locked++; } - return $dbw->selectField( 'image', '1', array( 'img_name' => $this->getName() ), __METHOD__ ); + return $dbw->selectField( 'image', '1', + array( 'img_name' => $this->getName() ), __METHOD__, array( 'FOR UPDATE' ) ); } /**