Помилка бази даних.

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE EXISTS ( SELECT `lfpr_sub`.`id` FROM `leo_filters_p...' at line 5

SELECT `lf`.*, `lft`.`type`, `lft`.`id` as `type_id`, `lft`.`slug` as `type_slug`, `lf`.`slug` as `value_slug` FROM `leo_filter_types` `lft` LEFT JOIN `leo_filters` `lf` ON `lf`.`type` = `lft`.`id` INNER JOIN `leo_filters_products_relations` `lfpr` ON `lfpr`.`filter_id` = `lf`.`id` AND `lfpr`.`product_id` = WHERE EXISTS ( SELECT `lfpr_sub`.`id` FROM `leo_filters_products_relations` AS `lfpr_sub` WHERE `lfpr_sub`.`filter_id` = `lf`.`id` AND EXISTS ( SELECT `sp`.`id` FROM `shop_products` AS `sp` WHERE `sp`.`id` = `lfpr_sub`.`product_id` AND sp.active = '1' AND ((IF(sp.unit = 'м2', sp.`count` >= sp.in_box, sp.`count` > 0)) OR (sp.discontinued <> 1)) AND (IF(sp.price_type = 'local', sp.price_local * sp.coefficient, sp.price * sp.coefficient)) > 0 AND IF(sp.manufacturer IS NOT NULL, LOWER(sp.manufacturer) NOT LIKE '%tubadzin%', 1) AND ( ( SELECT `lc`.`parent_id` FROM `leo_categories` AS `lc` WHERE `lc`.`id` IN ( SELECT `lcpr`.`category_id` FROM `leo_categories_products_relations` AS `lcpr` WHERE `lcpr`.`product_id` = `sp`.`id` ) LIMIT 1 ) = ( SELECT `lc`.`parent_id` FROM `leo_categories` AS `lc` WHERE `lc`.`id` IN ( SELECT `lcpr`.`category_id` FROM `leo_categories_products_relations` AS `lcpr` WHERE `lcpr`.`product_id` = `lfpr`.`product_id` ) LIMIT 1 ) ) ) )

Filename: libraries/MemCacheService.php

Line Number: 107