2006 - MySQL server has gone away

select DISTINCT p.products_id as id,p.products_so as so,pff.products_flags_so as flag_so,pff.products_flags_title as flag_title,pff.products_flags_icon as flag_icon,pff.products_flags_bg_color as flag_bg,pff.products_flags_txt_color as flag_txt,p.products_flag as flag,p.products_catalog_number,p.reviews,(p.ranking/5)*100 as rating,p.products_balikomat as balikomat,pd.products_short_description as short_description,pd.products_name as name,pd.products_title as title,pd.products_sef as sef,p.products_catalog_number as catalog_number,DATE_FORMAT(p.products_date_added,'%d.%m.%Y') as date_added,IF(p.products_date_available is not null, DATE_FORMAT(p.products_date_available,'%d.%m.%Y'),'') as date_available,p.products_delivery_period as delivery_period,p.products_tax_perc as tax,p.products_special as special,p.products_new as new,p.products_saleout as saleout,p.products_out_of_stock as out_of_stock,IF(p.products_special='1', IF(p.products_special_price_x_expire is null OR now() < p.products_special_price_x_expire, p.products_special_price*p.products_special_price_x,p.products_special_price),p.products_price) as price, p.products_price as price_normal,p.products_customers_special as customers_special,p.products_customers_special_price as customers_special_price,IF(p.products_special='1',p.products_special_price*p.products_special_price_x,IF(p.products_price>0.0,p.products_price,1000000.0)) as price_sort,p.products_current_price as current_price,p.products_image as image,( CASE WHEN p.products_postprice >= 0 THEN p.products_postprice WHEN m.manufacturers_postprice >= 0 THEN m.manufacturers_postprice ELSE (SELECT configuration_value FROM configuration WHERE configuration_key = 'SHOP_POSTPRICE') END ) as postprice ,IF(pn.products_id is null,'',pn.products_note) as note,m.manufacturers_name as man_name,pv.property_value as property_value, pt.property_name as property_name, pv.value_id as value_id, pv.type_id as type_id from products_to_categories ptc inner join products p on p.products_id=ptc.products_id inner join categories_description cd on cd.trees_id=ptc.categories_id inner join products_description pd on pd.products_id=p.products_id inner join manufacturers m on m.manufacturers_id=p.manufacturers_id left join products_flags pff on pff.products_flags_id = p.products_flag left join products_notes pn on (pn.products_id=p.products_id and pn.languages_id='4') OR pn.products_id=null LEFT JOIN properties_to_products ptp on ptp.product_id=p.products_id LEFT JOIN properties_value pv ON pv.value_id = ptp.value_id LEFT JOIN properties_type pt ON pt.type_id = pv.type_id AND pt.main_property=1 where p.products_status='1' and p.products_out_of_stock='0' and pd.languages_id='4' and m.manufacturers_enabled='1' and ((now() >= p.products_date_available or p.products_date_available is null) and (now() <= p.products_date_expire or p.products_date_expire is null)) and ptc.categories_id in (0,52,53,54,55,57,359,64,65,66,67,186,238,239,708,240,242,243,244,245,2507231,437,2507225,438,439,440,441,442,443,444,445,446,447,448,449,706,221,224,225,227,228,229,230,231,232,233,234,235,236,391,2507229,494,513,557,560,603,620,621,622,647,648,651,656,728,729,730,737,738,398,2507226,399,400,401,409,625,410,411,412,413,415,416,418,419,420,421,422,423,426,427,428,429,740,467,468,470,471,472,514,2507228,515,516,517,518,519,520,601,522,521,523,524,525,526,529,628,731,753,2507223,2507220,2507221,2507222,2507214,2507216,2507217,2507218,2507219,2507261,2507206,2507269,2507205,2507204,2507202,2507212,2507211,2507257,2507213,2507243,2507241,2507240,2507239,2507245,2507246,2507244,2507242,2507119,756,4,10,11,496,80,82,355,358,461,688,103,105,115,107,129,109,126,127,436,741,121,344,353,719,2507235,148,484,149,150,151,152,485,486,487,334,335,337,338,339,387,397,451,452,453,457,462,463,464,465,481,482,483,572,687,489,575,576,577,578,579,580,586,619,638,644,662,430,660,697,2507233,698,699,700,703,704,705,757,79,99,100,101,632,633,726,188,2507227,189,190,191,389,390,733,192,193,194,450,693,562,574,605,694,717,2507266,725,2507230,711,639,640,667,712,714,715,713,2507055,758,1,2,5,12,13,14,6,18,19,23,24,25,187,655,7,20,21,22,28,29,30,31,32,396,33,34,35,36,39,40,41,42,43,512,8,37,38,9,44,45,46,48,49,50,51,388,511,478,506,507,537,539,556,561,627,624,702,69,70,88,89,90,91,92,604,696,71,72,93,94,73,361,74,365,366,367,76,84,85,86,87,203,587,588,589,590,204,205,330,530,206,2507237,155,156,326,665,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,196,197,198,199,200,201,202,658,174,175,176,177,178,179,180,181,182,183,327,493,328,329,331,332,657,333,368,369,370,371,372,373,374,375,380,381,382,739,383,384,385,386,602,392,393,394,395,2507256,593,594,595,596,597,598,502,509,207,208,209,210,212,213,214,215,216,217,473,475,476,477,510,2507271,540,755,2507208,2507209,2507210,609,610,611,613,614,615,616,617,618,649,606,650,2507268,2507267,664,2507265,2507198,766,2507260,2507238,497,498,668,669,670,671,499,500,501,678,679,672,673,674,675,676,680,503,504,505,541,564,2507250,2507248,546,2507057,565,568,2507056,571,2507251,626,637,707,742,743,744,745,746,747,748,749,750,751,2507058,772,2507215,2507059,2507060,2507062,2507063,2507064,2507065,2507066,2507067,2507068,2507069,2507061,2507071,2507075,2507076,2507077,2507078,2507070,2507079,2507080,2507081,2507082,2507083,2507085,2507086,2507087,2507088,2507089,2507090,2507091,2507094,2507095,2507096,2507092,2507097,2507098,2507099,2507093,2507100,2507207,2507247,2507101,2507102,2507103,2507104,2507105,2507106,2507107,2507108,2507109,2507110,2507112,2507113,2507114,2507115,2507116,2507117,2507118,2507120,2507121,2507122,2507123,2507124,2507125,2507126,2507270,2507127,2507128,2507129,2507130,2507131,2507132,2507133,2507134,2507135,2507136,2507137,2507139,2507140,2507141,2507255,2507249,2507254,2507253,2507252,2507138,2507142,2507143,2507144,2507145,2507234,2507263,2507262,2507146,2507147,2507148,2507149,2507150,2507151,2507152,2507153,2507154,2507155,2507156,2507157,2507158,2507159,2507160,2507161,2507199,2507197,2507196,2507162,2507163,2507164,2507165,2507166,2507167,2507168,2507169,2507170,2507258,2507171,2507172,2507173,2507174,2507236,2507175,2507176,2507177,2507178,2507179,2507180,2507181,2507182,2507183,2507184,2507185,2507186,2507187,2507188,2507189,2507190,2507191,2507192,2507193,2507194,2507195,2507259) and p.manufacturers_id='14' order by pff.products_flags_so DESC, p.products_top desc

[TEP STOP]