Failed to execute the SQL query

select count(*) as cnt  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(c.mode & 8) and  not(i.unread & 8) and  not(i.unread & 4) and i.unread & 1 and  1=1 

Error 2013: Lost connection to server during query