Do not have non-mysql databases attempt mysql-sepcific GET_LOCK commands. Move all...
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Mon, 25 Dec 2006 17:28:21 +0000 (17:28 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Mon, 25 Dec 2006 17:28:21 +0000 (17:28 +0000)
includes/FileStore.php

index 294bf99..1fd35b0 100644 (file)
@@ -36,6 +36,9 @@ class FileStore {
         * @fixme Probably only works on MySQL. Abstract to the Database class?
         */
        static function lock() {
+               global $wgDBtype;
+               if ($wgDBtype != 'mysql')
+                       return true;
                $dbw = wfGetDB( DB_MASTER );
                $lockname = $dbw->addQuotes( FileStore::lockName() );
                $result = $dbw->query( "SELECT GET_LOCK($lockname, 5) AS lockstatus", __METHOD__ );
@@ -54,6 +57,9 @@ class FileStore {
         * Release the global file store lock.
         */
        static function unlock() {
+               global $wgDBtype;
+               if ($wgDBtype != 'mysql')
+                       return true;
                $dbw = wfGetDB( DB_MASTER );
                $lockname = $dbw->addQuotes( FileStore::lockName() );
                $result = $dbw->query( "SELECT RELEASE_LOCK($lockname)", __METHOD__ );