Lost connection to MySQL server during query

select distinct A.price, A.count, A.suma, B.name, B.prod_code, B.linkname, C.linkname as cat_link, B.id, D.count as stock, B.id as prod_id, A.svoris from infol_orders_cart as A left join infol_products as B on A.prod_code = B.prod_code left join sodo_pages as C on C.id = B.cat_id left join infol_stocks_products as D on D.prod_code = B.prod_code and D.stock = '1010' where A.ses_id = '7fb009779d055569f4106941e4669067' order by A.cr_date desc