Ошибка в SQL:

SELECT DISTINCT bbsc.banner_id, bb.* FROM brandbook_banners_show_categories bbsc INNER JOIN brandbook_banners bb ON bb.id = bbsc.banner_id WHERE bbsc.category_id = 3 AND bb.active != 0 AND (bb.date_begin <= "2017-07-26 01:52:43" OR bb.date_begin = "0000-00-00 00:00:00") AND (bb.date_end >= "2017-07-26 01:52:43" OR bb.date_end = "0000-00-00 00:00:00") AND (bb.show_limit = 0 OR bb.view_random < bb.show_limit) ORDER BY RAND()

Disk full (/var/lib/tmp_mysql/#sql_66f_0); waiting for someone to free some space...