Dotmedia error handler

Out of resources when opening file '/tmp/#sql_5671_0.MAI' (Errcode: 24 "Too many open files") - SELECT SQL_CALC_FOUND_ROWS product.id AS id, top AS top, new AS new, IF ((SELECT count(*) > 0 FROM packing WHERE productId = product.id), (SELECT count(*) > 0 FROM packing WHERE productId = product.id AND packing.availability), availability) AS availability,
categoryid AS categoryId, caption AS caption, description AS description,
IF(price > 0, IF (COALESCE(pud.discount, cud.discount) IS NOT NULL, ROUND(price*(1-COALESCE(pud.discount, cud.discount)/100),2),price),
(SELECT MIN(IF (COALESCE(pud.discount, cud.discount) IS NOT NULL, ROUND(price*(1-COALESCE(pud.discount, cud.discount)/100),2),price)) FROM packing WHERE productId = product.id AND quantity = 1 ORDER BY price ASC LIMIT 1)) AS price, file AS file,
hot AS hot, indexhot AS indexHot, product.uid AS uid, hotofferdescription AS hotOfferDescription, filename, pp.id, CONCAT(c2.name, ' > ', c1.name) AS categoryName,
price AS originalPrice, COALESCE(pud.discount, cud.discount) AS discount, product.active, product.price = 0 AS packPrice
FROM product
LEFT JOIN picture_2_product pp ON pp.productId = product.id
INNER JOIN product_cat c1 ON c1.id = categoryId
INNER JOIN product_cat c2 ON c2.id = c1.parent_id
LEFT JOIN product_user_discount pud ON pud.user_id = 0 AND pud.product_id = product.id
LEFT JOIN category_user_discount cud ON cud.user_id = 0 AND cud.category_id = product.categoryId
WHERE product.active AND categoryId in (198) AND 1 = 1 GROUP BY product.id ORDER BY RAND() LIMIT 1,10
0 FROM packing WHERE productId = product.id), (SELECT count(*) > 0 FROM packing WHERE productId = product.id AND packing.availability), availability) AS availability,
categoryid AS categoryId, caption AS caption, description AS description,
IF(price > 0, IF (COALESCE(pud.discount, cud.discount) IS NOT NULL, ROUND(price*(1-COALESCE(pud.discount, cud.discount)/100),2),price),
(SELECT MIN(IF (COALESCE(pud.discount, cud.discount) IS NOT NULL, ROUND(price*(1-COALESCE(pud.discount, cud.discount)/100),2),price)) FROM packing WHERE productId = product.id AND quantity = 1 ORDER BY price ASC LIMIT 1)) AS price, file AS file,
hot AS hot, indexhot AS indexHot, product.uid AS uid, hotofferdescription AS hotOfferDescription, filename, pp.id, CONCAT(c2.name, ' > ', c1.name) AS categoryName,
price AS originalPrice, COALESCE(pud.discount, cud.discount) AS discount, product.active, product.price = 0 AS packPrice
FROM product
LEFT JOIN picture_2_product pp ON pp.productId = product.id
INNER JOIN product_cat c1 ON c1.id = categoryId
INNER JOIN product_cat c2 ON c2.id = c1.parent_id
LEFT JOIN product_user_discount pud ON pud.user_id = 0 AND pud.product_id = product.id
LEFT JOIN category_user_discount cud ON cud.user_id = 0 AND cud.category_id = product.categoryId
WHERE product.active AND categoryId in (198) AND 1 = 1 GROUP BY product.id ORDER BY RAND() LIMIT 1,10 ">Bug report

Show/Hide backtrace