https://bugzilla.wikimedia.org/show_bug.cgi?id=39635

       Web browser: ---
             Bug #: 39635
           Summary: PostgreSQL LOCK IN SHARE MODE option is a syntax error
           Product: MediaWiki
           Version: 1.19.0
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: Database
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


When refreshing a category page, MediaWiki issues a query to my PostgreSQL
backend ending in "LOCK IN SHARED MODE". This isn't valid syntax to PGSQL.

I have edited my copy of includes/db/Database.php,
DatabaseBase::selectSQLText() to include...

                if ($this->getType() == 'postgres' and
                        (in_array('LOCK IN SHARE MODE', $options, true) or
                        isset($options['LOCK IN SHARE MODE'])))
                {
                        // just fail       
                        //throw new Exception('Cannot use LOCK IN SHARE MODE
with Postgresql');
                        // or just remove the option
                        unset($options['LOCK IN SHARE MODE']);
                        unset($options[array_search('LOCK IN SHARE MODE',
$options, true)]);
                }

The lack of a locking operation seems to me to be a better tradeoff than a
category page flooded with pg_query error output.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to