Merge "HttpFunctions: Increase code coverage"
[lhc/web/wiklou.git] / includes / filebackend / lockmanager / MySqlLockManager.php
index f4ff71e..8510d0c 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * MySQL version of DBLockManager that supports shared locks.
  *
@@ -19,6 +22,12 @@ class MySqlLockManager extends DBLockManager {
                self::LOCK_EX => self::LOCK_EX
        ];
 
+       public function __construct( array $config ) {
+               parent::__construct( $config );
+
+               $this->session = substr( $this->session, 0, 31 ); // fit to field
+       }
+
        protected function initConnection( $lockDb, IDatabase $db ) {
                # Let this transaction see lock rows from other transactions
                $db->query( "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;" );
@@ -28,7 +37,7 @@ class MySqlLockManager extends DBLockManager {
 
        /**
         * Get a connection to a lock DB and acquire locks on $paths.
-        * This does not use GET_LOCK() per http://bugs.mysql.com/bug.php?id=1118.
+        * This does not use GET_LOCK() per https://bugs.mysql.com/bug.php?id=1118.
         *
         * @see DBLockManager::getLocksOnServer()
         * @param string $lockSrv