2013 - Lost connection to MySQL server during query

select distinct p.products_id, pd.products_name, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id, products_description pd, products_to_categories p2c, categories c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '2822' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit 5

[TEP STOP]