_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_marka`='39' AND b.`foto` IS NOT NULL ORDER BY RAND() LIMIT 0,5