Out of resources when opening file '/tmp/#sqla49_cd623_0.MYD' (Errcode: 24)
CREATE TEMPORARY TABLE info_db AS ( select m.*, mv.* from (SELECT pid as temp_matching_id , MAX(IF(field = 'name_tc', value, NULL)) AS 'name_tc' , MAX(IF(field = 'name_sc', value, NULL)) AS 'name_sc' , MAX(IF(field = 'name_en', value, NULL)) AS 'name_en' , MAX(IF(field = 'visit_email', value, NULL)) AS 'visit_email' , MAX(IF(field = 'contact_us_email', value, NULL)) AS 'contact_us_email' , MAX(IF(field = 'weibo', value, NULL)) AS 'weibo' , MAX(IF(field = 'facebook', value, NULL)) AS 'facebook' , MAX(IF(field = 'google_plus', value, NULL)) AS 'google_plus' , MAX(IF(field = 'youtube', value, NULL)) AS 'youtube' , MAX(IF(field = 'home_content_title1_tc', value, NULL)) AS 'home_content_title1_tc' , MAX(IF(field = 'home_content_title1_sc', value, NULL)) AS 'home_content_title1_sc' , MAX(IF(field = 'home_content_title1_en', value, NULL)) AS 'home_content_title1_en' , MAX(IF(field = 'home_content_title2_tc', value, NULL)) AS 'home_content_title2_tc' , MAX(IF(field = 'home_content_title2_sc', value, NULL)) AS 'home_content_title2_sc' , MAX(IF(field = 'home_content_title2_en', value, NULL)) AS 'home_content_title2_en' , MAX(IF(field = 'home_content_title3_tc', value, NULL)) AS 'home_content_title3_tc' , MAX(IF(field = 'home_content_title3_sc', value, NULL)) AS 'home_content_title3_sc' , MAX(IF(field = 'home_content_title3_en', value, NULL)) AS 'home_content_title3_en' , MAX(IF(field = 'home_content_title4_tc', value, NULL)) AS 'home_content_title4_tc' , MAX(IF(field = 'home_content_title4_sc', value, NULL)) AS 'home_content_title4_sc' , MAX(IF(field = 'home_content_title4_en', value, NULL)) AS 'home_content_title4_en' , MAX(IF(field = 'alert_tc', value, NULL)) AS 'alert_tc' , MAX(IF(field = 'alert_sc', value, NULL)) AS 'alert_sc' , MAX(IF(field = 'alert_en', value, NULL)) AS 'alert_en' , MAX(IF(field = 'show_alert', value, NULL)) AS 'show_alert' FROM main_value_db group by pid ) as mv left join main_db m on m.id = mv.temp_matching_id where m.module = 'info' )