_NOT_QUERY: Got error 122 from storage engine

Query: SELECT b.*,concat('index.php?mod=bid&task=detail&id=',b.id) as link, m.name as model_name, ma.name as marka_name, city.name as city_name FROM reg_mainr01 as b LEFT JOIN reg_marka as ma ON ma.id = b.id_marka LEFT JOIN reg_model as m ON m.id = b.id_model LEFT JOIN reg_city as city ON city.id = b.id_city WHERE b.`id_model`='464' AND b.id != '9299' AND b.id_city = '4' AND (b.`foto` IS NOT NULL OR b.`foto` != '' OR b.`foto` != ' ' OR b.`foto` != '|') ORDER BY RAND() LIMIT 0,5