2006 MySQL server has gone away
in:
[select distinct pds.pid as also_id, p.short_name as also_name, p.hide_price as also_hide_price, p.no_price as also_no_price,
IF(p.products_thumb is not null and p.products_thumb!='',p.products_thumb,p.products_image) as also_image, p.cost as also_cost,MAX(CASE WHEN dsc.config_key='CELL_CONNECTOR' then pds.ds_cid end) as CELL_CONNECTOR,MAX(CASE WHEN dsc.config_key='WIFI_CONNECTOR' then pds.ds_cid end) as WIFI_CONNECTOR,MAX(CASE WHEN dsc.config_key='GPS_CONNECTOR' then pds.ds_cid end) as GPS_CONNECTOR,MAX(CASE WHEN dsc.config_key='ANTENNA_TYPE' then pds.ds_cid end) as ANTENNA_TYPE,MAX(CASE WHEN dsc.config_key='ANTENNA_COLOR' then pds.ds_cid end) as ANTENNA_COLOR,MAX(CASE WHEN pds.ds_key='MAX_CELL_CONNECTORS' then pds.ds_value end) as MAX_CELL_CONNECTORS,MAX(CASE WHEN pds.ds_key='MAX_WIFI_CONNECTORS' then pds.ds_value end) as MAX_WIFI_CONNECTORS,MAX(CASE WHEN pds.ds_key='MAX_GPS_CONNECTORS' then pds.ds_value end) as MAX_GPS_CONNECTORS from products_dsearch pds
join products p on pds.pid=p.products_id
left join dsearch_config dsc on pds.ds_cid=dsc.id
where pds.pid!=8571 and p.total_quantity>0
and p.types_id in (1,102,103,104,105,109,121) and (
/*(p.group_id>0 and p.group_master=1 and p.prevent_from_search=0)
or*/
(p.group_id>0 and p.group_master=0 and p.products_model not like '*%')
or
(p.group_id=0 and p.prevent_from_search=0 and p.products_model not like '*%')
)
and (
pds.ds_key in ('MAX_CELL_CONNECTORS','MAX_WIFI_CONNECTORS','MAX_GPS_CONNECTORS')
or
dsc.config_key in ('CELL_CONNECTOR','WIFI_CONNECTOR','GPS_CONNECTOR','ANTENNA_TYPE','ANTENNA_COLOR')
)
group by pds.pid having (CELL_CONNECTOR='51' and WIFI_CONNECTOR='11' and GPS_CONNECTOR='16' and ANTENNA_TYPE='37' and ANTENNA_COLOR='34' and MAX_CELL_CONNECTORS='0' and MAX_WIFI_CONNECTORS>='2' and MAX_GPS_CONNECTORS>='1') order by p.total_quantity desc,p.products_price_sorter asc,p.products_sort_order asc,p.total_rating desc,also_name asc]