Failed to execute the SQL query

select  i.title,  c.title, c.id, i.unread, i.url, i.enclosure, i.author, i.description, c.icon,  unix_timestamp(ifnull(i.pubdate,i.added)) as ts,  i.pubdate is not null as ispubdate, i.id  , null  from  ipo__item  i  inner join  ipo__channels  c on (c.id = i.cid)  inner join  ipo__folders  f on (f.id = c.parent)  where  not(i.unread & 8) and  not(i.unread & 4) and i.cid = 89 and month(ifnull(i.pubdate,i.added))= 9  and year(ifnull(i.pubdate, i.added))= 2017  and dayofmonth(ifnull(i.pubdate,i.added))= 6  and  1=1  order by  ts desc, f.position asc, c.position asc , ts desc, i.id asc limit  0, 50

Error 2013: Lost connection to server during query