From 7770391b3044f4271269b5e7114bd0719a69920a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 20 Mar 2012 00:57:18 +0000 Subject: [PATCH] [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. --- includes/filerepo/file/LocalFile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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' ) ); } /** -- 2.20.1