Out of resources when opening file '/tmp/#sql_298_0.MYI' (Errcode: 24) SQL=SELECT m.*, sum(case when p.published=1 then 1 else 0 end) as cnt FROM tin_menu AS m LEFT JOIN tin_menu AS p ON p.parent = m.id WHERE m.menutype='mainmenu' AND m.published='1' AND m.access <= 0 GROUP BY m.id ORDER BY m.parent, m.ordering