An autoblock is a block against an IP address, spawned from a block against a user account. For an autoblock, the ipb_parent_block_id column holds the ID of the block that spawned it.
All other blocks should have ipb_parent_block_id = null.
However, if a (non-auto)block is updated, it is re-saved with ipb_parent_block_id set to 0.
The bug seems to come from this line: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/9ba56ccb3b85175da3de36e6b9f9c0a30c007d1f/includes/block/DatabaseBlock.php#463
Example from itwiki:
> SELECT COUNT(*) FROM ipblocks WHERE ipb_parent_block_id = 0; +----------+ | COUNT(*) | +----------+ | 898 | +----------+ > SELECT COUNT(*) FROM ipblocks WHERE ipb_parent_block_id = 0 AND ipb_user != 0; +----------+ | COUNT(*) | +----------+ | 842 | +----------+
The first case shouldn't be possible, because no blocks have ipb_id = 0, and the second shouldn't be possible because all blocks against a user account (i.e. ipb_user is nonzero) should have ipb_parent_block_id = null.