That change seemed to cause problems

Started seeing queries like this one:

SELECT "entities".* FROM (WITH RECURSIVE crumbs AS (
 SELECT entities.*, 0 AS depth FROM entities WHERE parent_id IS NULL
 UNION ALL
 SELECT alias1.*, crumbs.depth + 1 FROM crumbs JOIN entities alias1 on
alias1.parent_id = crumbs.id
 WHERE crumbs.depth + 1 < 100000
 ) SELECT * FROM crumbs) as entities WHERE (entities.depth >= 0) AND
(entities.depth + 1 < 100002)