Query:
select tgs.name, tst.has_tables, tst.show_other_groups,
tst.rounds, tgs.group, tgs.stage, tst.tournament, t.inter_filter,
tst.equal_income, ifnull(c1.id, 0) as cnt1, ifnull(c2.id, 0) as cnt2,
c1.div2 as has_div2
from tournament_groups_stages tgs, tournament_stages tst, tournaments t,
tournament_groups_stages tgs1
left join countries c1 on c1.div1 = tgs1.id,
tournament_groups_stages tgs2
left join countries c2 on c2.div2 = tgs2.id
where tgs.id = '496' and tst.id = tgs.stage and t.id = tst.tournament
and tgs1.id = tgs.id and tgs2.id = tgs.id
and tgs.season = 12 and tst.season = 12
error: Out of resources when opening file './fb_arc/tournament_stages.MYD' (Errcode: 24)