A Database Error Occurred
Error Number: 1
Can't create/write to file '/var/lib/mysqltmp/#sql_13ed_0.MYI' (Errcode: 13)
select sql_no_cache p.id, p.product_grp_id, pg.products_active_qty, group_concat(tp.tag_id), sum(if(pgs.school_id=191 and tp.pos=1,4.04, 0)*if(pg.is_promote,1.05,1)+if(pgs2.school_id=191 and tp.pos=1,2.02, 0)*if(pg.is_promote,1.05,1)) weight_school, sum(if(pgs.school_id=191 and tp.pos=1,4.04, 0)*if(pg.is_promote,1.05,1)+if(pgs2.school_id=191 and tp.pos=1,2.02, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=621,8/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=1309,4/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=94,2/tp.pos, 0)*if(pg.is_promote,1.05,1)+if(tp.tag_id=1637,1/tp.pos, 0)*if(pg.is_promote,1.05,1)) weight from base_product p left join base_product_grp pg on pg.id=p.product_grp_id left join base_product_grp_school pgs on pgs.product_grp_id=pg.id and pgs.pos=1 left join base_product_grp_school pgs2 on pgs2.product_grp_id=pg.id and pgs2.pos=2 left join base_tag_ppg tp on tp.product_id=p.id where 1 and p.status='active' and pg.status='active' and pg.id!=1 and (tp.tag_id in (621,1309,94,1637) or pgs.school_id=191) group by p.id order by weight desc, pg.date_start desc