SQL Error: Out of resources when opening file '/tmp/#sql_30ca_0.MYI' (Errcode: 24 - Too many open files) at /home/shef/vestnik.isras.ru/html/dreamedit/includes/class.Events.php line 93
Array
(
    [code] => 23
    [message] => Out of resources when opening file '/tmp/#sql_30ca_0.MYI' (Errcode: 24 - Too many open files)
    [query] => SELECT * FROM
			(SELECT  ie.el_id AS ARRAY_KEY, ie.*,IF(ie.itype_id=2 AND id2.icont_text>id.icont_text,id2.icont_text,id.icont_text) AS date,
				IFNULL(id2.icont_text,0) AS date2 FROM isras2015.adm_ilines_element AS ie, isras2015.adm_ilines_content AS ic INNER JOIN isras2015.adm_ilines_content AS id ON id.el_id=ic.el_id AND (id.icont_var='date' )
			AND date(id.icont_text) >= date('20180721') AND date(id.icont_text) <= date('20180721') LEFT OUTER JOIN isras2015.adm_ilines_content AS id2 ON id2.el_id=ic.el_id AND (id2.icont_var='date2')
			AND date(id2.icont_text) >= date('20180721') AND date(id2.icont_text) <= date('20180721') INNER JOIN isras2015.adm_ilines_content AS ss ON ss.el_id=ic.el_id AND ss.icont_var='status' AND ss.icont_text=1  LEFT OUTER JOIN isras2015.adm_ilines_content AS s2 ON s2.el_id=ic.el_id AND s2.icont_var='status2'   INNER JOIN isras2015.adm_ilines_element AS e ON e.el_id=ic.el_id WHERE ( ie.itype_id=2 OR  ie.itype_id=3 OR  ie.itype_id=14 OR  ie.itype_id=15 OR  ie.itype_id=16) AND ie.el_id = ic.el_id  AND (ic.icont_var  = 'date' OR ic.icont_var='date2') AND ic.icont_text <> '' AND ic.icont_text IS NOT NULL  AND (e.itype_id<> 15 OR s2.icont_text=1)  GROUP BY ie.el_id   UNION  SELECT ie.el_id, ie.*,id2.icont_text AS date,IFNULL(id2.icont_text,0) AS date2
				FROM isras2015.adm_ilines_element AS ie
				INNER JOIN isras2015.adm_ilines_content AS id ON id.el_id=ie.el_id AND id.icont_var='date'
				INNER JOIN isras2015.adm_ilines_content AS id2 ON id2.el_id=ie.el_id AND id2.icont_var='date2'
				INNER JOIN isras2015.adm_ilines_content AS ss ON ss.el_id=ie.el_id AND ss.icont_var='status' AND ss.icont_text=1
				WHERE (ie.itype_id=14 OR ie.itype_id=2 )
				AND date(id2.icont_text) >= date('20180721') AND date(id2.icont_text) <= date('20180721')  GROUP BY ie.el_id

			) AS t  ORDER BY date  DESC    LIMIT 0, 10   
    [context] => /home/shef/vestnik.isras.ru/html/dreamedit/includes/class.Events.php line 93
)