Yeah I got that from brad's post, However what I meant was I'm surprised you had to do this:
select a.id, a.name, b.name, b.parent, @i := a.id
from category a
left join items b on b.id in (select * from(select id from items where parent = @i limit 5) t)
order by a.id
Instead of this:
select a.id, a.name, b.name, b.parent, @i := a.id
from category a
left join items b on b.id in (select id from items where parent = @i limit 5)
order by a.id
However looking at it now I'm still surprised it works, because your "working" query still has a limit in a subquery O_o