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

       Web browser: ---
             Bug #: 35572
           Summary: Blocks appear to succeed even if query fails due to
                    wrong DB structure
           Product: MediaWiki
           Version: 1.20-svn
          Platform: All
               URL: https://gerrit.wikimedia.org/r/#change,3841,patchset=3
        OS/Version: All
            Status: NEW
          Keywords: postgresql
          Severity: major
          Priority: Unprioritized
         Component: Database
        AssignedTo: [email protected]
        ReportedBy: [email protected]
            Blocks: 384
    Classification: Unclassified
   Mobile Platform: ---


When testing gerrit change 3841 noticed that when I forgot to run update.php
the query fails as expected:

Query trunk (90) (slave): INSERT /* Block::insert Saper */ INTO "ipblocks"
(ipb_address,ipb_user,ipb_by,ipb_by_text,ipb_reason,ipb_timestamp,ipb_auto,ipb_anon_only,ipb_create_account,ipb_enable_autoblock,ipb_expiry,ipb_range_start,ipb_range_end,ipb_deleted,ipb_block_email,ipb_allow_usertalk,ipb_cause,ipb_id)
VALUES ('Test5','2','1','Saper','Bez autoblock','2012-03-28 18:50:57
GMT','0',0,0,0,'2012-03-29 18:50:57 GMT','','','0',0,0,NULL,'137')
Query trunk (91) (slave): ROLLBACK
SQL ERROR (ignored): ERROR:  column "ipb_cause" of relation "ipblocks" does not
exist
LINE 1: ...nd,ipb_deleted,ipb_block_email,ipb_allow_usertalk,ipb_cause,...
                                                             ^
Query trunk (92) (slave): BEGIN
Transaction state changed from IDLE -> TRANS

But the error is ignored due to generic workaround for errors encountered
during INSERT IGNORE. (This one is from Block.php:444).

The MediaWiki says then everything is OK and even this block gets logged in the
log, but is not active. 

HOW TO REPRODUCE:

Apply gerrit change 3841 patchset 3 to 8824515e571eadd4a63b09e1331f35309315603f
and try to block some user. The query will fail but MediaWiki says all is fine.

PROPOSED FIX:

I would propose to narrow down ignorable query failures only to violations of
primary keys.

Another thing is it would be good to check if log entry gets rollbacked too in
case of fatal error.

-- 
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