1053 - Server shutdown in progress
select c.categories_id, ifnull(cd.categories_heading_title, cd.categories_name) as title from ((categories c inner join categories_description cd on (c.categories_id = cd.categories_id) and (cd.language_id = 1)) left join categories c2 on (c2.parent_id = c.categories_id)) left join products_to_categories ptc on (c.categories_id = ptc.categories_id) where (c.parent_id = 0) and (c.sort_order >= 0) group by c.categories_id, title having (count(c2.categories_id) > 0) or (count(ptc.products_id) > 0) order by c.sort_order, title
STOP