Last modified: 2012-08-04 20:48:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37572, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35572 - Blocks appear to succeed even if query fails due to wrong DB structure
Blocks appear to succeed even if query fails due to wrong DB structure
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.20.x
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
https://gerrit.wikimedia.org/r/#chang...
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2012-03-28 19:31 UTC by Marcin Cieślak
Modified: 2012-08-04 20:48 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Marcin Cieślak 2012-03-28 19:31:47 UTC
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.
Comment 1 Marcin Cieślak 2012-03-30 03:21:17 UTC
Fixed in Gerrit change #3977

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links