MySQL Query Error: SELECT COUNT('x') as C
FROM
b_iblock B
INNER JOIN b_lang L ON B.LID=L.LID
INNER JOIN b_iblock_element BE ON BE.IBLOCK_ID = B.ID
INNER JOIN b_iblock_element_prop_s24 FPS0 ON FPS0.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_property_enum FPEN0 ON FPEN0.PROPERTY_ID = 493 AND FPS0.PROPERTY_493 = FPEN0.ID
LEFT JOIN b_iblock_property_enum FPEN1 ON FPEN1.PROPERTY_ID = 502 AND FPS0.PROPERTY_502 = FPEN1.ID
LEFT JOIN b_iblock_property_enum FPEN2 ON FPEN2.PROPERTY_ID = 503 AND FPS0.PROPERTY_503 = FPEN2.ID
LEFT JOIN b_iblock_property_enum FPEN3 ON FPEN3.PROPERTY_ID = 501 AND FPS0.PROPERTY_501 = FPEN3.ID
LEFT JOIN b_iblock_property_enum FPEN4 ON FPEN4.PROPERTY_ID = 506 AND FPS0.PROPERTY_506 = FPEN4.ID
LEFT JOIN b_iblock_property_enum FPEN5 ON FPEN5.PROPERTY_ID = 508 AND FPS0.PROPERTY_508 = FPEN5.ID
INNER JOIN (
SELECT DISTINCT BSE.IBLOCK_ELEMENT_ID
FROM b_iblock_section_element BSE
INNER JOIN b_iblock_section BS ON BSE.IBLOCK_SECTION_ID = BS.ID
WHERE ((BS.ID IN (2179, 2185)))
) BES ON BES.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_catalog_price CAT_P2 ON (CAT_P2.PRODUCT_ID = BE.ID AND CAT_P2.CATALOG_GROUP_ID = 2)
LEFT JOIN b_catalog_product CAT_PR ON (CAT_PR.ID = BE.ID)
LEFT JOIN b_catalog_iblock CAT_IB ON ((CAT_PR.VAT_ID IS NULL OR CAT_PR.VAT_ID = 0) AND CAT_IB.IBLOCK_ID = BE.IBLOCK_ID)
LEFT JOIN b_catalog_vat CAT_VAT ON (CAT_VAT.ID = IF((CAT_PR.VAT_ID IS NULL OR CAT_PR.VAT_ID = 0), CAT_IB.VAT_ID, CAT_PR.VAT_ID))
WHERE 1=1
AND (
((((BE.IBLOCK_ID = '24'))))
AND ((((CAT_P2.PRICE > '1'))))
AND ((((BE.DETAIL_PICTURE > '0'))))
AND ((((FPS0.PROPERTY_498 >= '1'))))
)
AND (((BE.WF_STATUS_ID=1 AND BE.WF_PARENT_ELEMENT_ID IS NULL)))
[Lost connection to MySQL server during query]