MW api list=blocks doesn't return very old blocks where ipb_range_start is empty
Open, Needs TriagePublic

Description

Compare https://en.wikipedia.org/w/api.php?format=json&action=query&list=blocks&bkip=121.143.29.30&bklimit=1&bkprop=expiry|reason and https://en.wikipedia.org/wiki/Special:BlockList?wpTarget=121.143.29.30

It seems to be due to very old blocks before range blocks were a thing. the api does a query like:

SELECT ipb_auto,ipb_id,ipb_timestamp,ipb_expiry,ipb_reason AS "ipb_reason_text",NULL AS "ipb_reason_data",NULL AS "ipb_reason_cid" FROM ipblocks WHERE (ipb_range_start LIKE '798F%' ESCAPE '`' ) AND (ipb_range_start <= '798F1D1E') AND (ipb_range_end >= '798F1D1E') AND ipb_auto = '0' AND ipb_deleted = '0' AND (ipb_expiry > '20180207235311') ORDER BY ipb_timestamp DESC,ipb_id DESC LIMIT 2 ;

wich won't match it.

Bawolff created this task.Feb 7 2018, 11:57 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 7 2018, 11:57 PM
Anomie added a subscriber: Anomie.

IMO the proper fix is for someone to write and execute a maintenance script to populate the ipb_range_start and ipb_range_end fields for such blocks.

Anomie added a comment.EditedMar 20 2018, 2:19 AM

Hmm. It seems T51504: ipb_range_start and ipb_range_end should be blank for single-IP blocks calls for not populating these fields on single-IP blocks.