Last modified: 2014-04-17 11:02:17 UTC
When an IP address is pased to the function Block::parseTarget(), it creates a new user from it. However, it returns the wrong type Block::TYPE_IP instead of the correct Block::TYPE_USER. The consequence of this behaviour is that the caller function Block::newLoad() tries to convert the returned value from IP to hex with the IP::toHex() function. This leads to a wrong value returned by getRangeCond(), which then results in a database problem: 2014-04-16 12:46:47 CEST ERROR: operator does not exist: text <= integer at character 379 2014-04-16 12:46:47 CEST HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. 2014-04-16 12:46:47 CEST STATEMENT: SELECT /* Block::newLoad xxx.yyy.zzz.iii */ 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 IN ('xxx.yyy.zzz.iii','MyUsername') OR ((ipb_range_start LIKE '%' ) AND (ipb_range_start <= 0) AND (ipb_range_end >= 0))
Created attachment 15128 [details] Proposed patch to return correct TYPE_USER
Hi! Thanks for your patch! You are welcome to use Developer access https://www.mediawiki.org/wiki/Developer_access to submit this as a Git branch directly into Gerrit: https://www.mediawiki.org/wiki/Git/Tutorial Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/ Thanks again!