SQL Query Error (SELECT cheat.*, cvs.name as view_status_name, cheat_status.name AS status_name, -- if (coalesce(sum(if(votes.ignored=1, 0, votes.ref_vote_variant)), 0)+1<0, 0, coalesce(sum(if(votes.ignored=1, 0, votes.ref_vote_variant)), 0)+1) rating, cheat.precalc_rating rating, coalesce(count(votes.ref_vote_variant), 0) AS votes_count, users.name AS user_name, users.ref_user_status, case when users.ref_user_group=1 then 1 else 0 end AS user_is_admin, submission_type.name AS submission_type_name, submission_type.filter_title AS submission_type_filter_title, submission_type.filter_name AS submission_type_filter_name, gt.title AS game_name, games.link_friendly_name AS game_link_friendly_name, if(cheat.updated_by_owner, cheat.updated_by_owner, null) updated_by_owner_null, if(cheat.updated_by_owner, cheat.updated_by_owner, cheat.creation) created_updated_by_owner, platforms.short_name AS platform_short_name, platforms.image_icon_platform as platform_icon, platforms.image_iconh_platform as platform_iconh FROM (cheats AS cheat) INNER JOIN cheat_status AS cheat_status ON cheat.ref_cheat_status = cheat_status.id INNER JOIN submission_types AS submission_type ON cheat.ref_submission_type = submission_type.id LEFT OUTER JOIN votes AS votes ON cheat.id = votes.ref_cheat INNER JOIN users AS users ON cheat.ref_user = users.id INNER JOIN games AS games ON cheat.ref_game = games.id INNER JOIN game_titles AS gt ON (games.id = gt.ref_game and gt.is_primary = 1) INNER JOIN platforms AS platforms ON games.ref_platform = platforms.id INNER JOIN cheat_view_statuses as cvs on cvs.id = cheat.ref_view_status WHERE 1=1 AND (cheat.ref_view_status = 2) AND cheat.ref_game = '4890' AND cheat.ref_submission_type in (1, 5) AND cheat.ref_cheat_status <> 3 AND coalesce(cheat.ref_main_cheat, 0) = 0 GROUP BY cheat.id ORDER BY if(ref_view_status = 1, 1, 0) desc, rating desc, votes_count asc, id asc) : Got error 28 from storage engine