Last modified: 2014-01-17 00:31:15 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 T62035, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60035 - Block::newLoad malformed db query
Block::newLoad malformed db query
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Aaron Schulz
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-14 12:23 UTC by Sean Pringle
Modified: 2014-01-17 00:31 UTC (History)
2 users (show)

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


Attachments

Description Sean Pringle 2014-01-14 12:23:53 UTC
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.
Comment 1 Aaron Schulz 2014-01-15 02:48:40 UTC
Was the IP invalid or something?
Comment 2 Sean Pringle 2014-01-15 03:16:42 UTC
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?
Comment 3 Gerrit Notification Bot 2014-01-15 03:59:02 UTC
Change 107543 had a related patch set uploaded by Aaron Schulz:
Workaround ip2long limitation

https://gerrit.wikimedia.org/r/107543
Comment 4 Gerrit Notification Bot 2014-01-17 00:28:40 UTC
Change 107543 merged by jenkins-bot:
Workaround ip2long limitation

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

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


Navigation
Links