Page MenuHomePhabricator

Block::newLoad malformed db query
Closed, ResolvedPublic

Description

Found examples of the following in the slow logs:

SELECT /* Block::newLoad */ ipb_id, ipb_address, ipb_by, ipb_by_text, ipb_reason, ipb_timestamp, ipb_auto, ipb_anon_only, ipb_create_account, ipb_enable_autoblock, ipb_expiry, ipb_deleted, ipb_block_email, ipb_allow_usertalk, ipb_parent_block_id FROM ipblocks WHERE ipb_address = 'xxx.xxx.xxx.xxx' OR ((ipb_range_start LIKE '%' ) AND (ipb_range_start <= '') AND (ipb_range_end >= ''))

The xxx.xxx.xxx.xxx is redacted, but the empty LIKE '%' and <= '' clauses are verbatim.

This seems wrong, and in any case causes a table scan which hurts on enwiki.


Version: 1.23.0
Severity: normal

Details

Reference
bz60035

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:52 AM
bzimport added a project: Mediawiki-Rdbms.
bzimport set Reference to bz60035.
aaron added a comment.Jan 15 2014, 2:48 AM

Was the IP invalid or something?

Good question. All examples I can find have leading zeros on the last two octets, eg:

xxx.xxx.037.08

Odd, though is it actually invalid?

Change 107543 had a related patch set uploaded by Aaron Schulz:
Workaround ip2long limitation

https://gerrit.wikimedia.org/r/107543

Change 107543 merged by jenkins-bot:
Workaround ip2long limitation

https://gerrit.wikimedia.org/r/107543