Qrong query!: Disk full (/tmp/#sql_1_3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
SELECT tb1.*,IF(cl.`instock` IS NULL,tb1.`instock`,cl.`instock`) as 'n-instock',IF(cl.`order` IS NULL,tb1.`order`,cl.`order`) as 'n-order' FROM `a_items` tb1 LEFT JOIN `a_gallery` as tg ON tb1.`id`=tg.`parent` LEFT JOIN `a_items` as cl ON tb1.`source`=cl.`id` WHERE tb1.`status` IN ('enabled','clone') AND tb1.`is-hide`='disabled' AND (cl.`is-arhiv`='disabled' OR (cl.`is-arhiv` IS NULL AND tb1.`is-arhiv`='disabled')) AND (tg.id IS NOT NULL OR tb1.instock='enabled') AND tb1.`parent`='1516' GROUP BY tb1.`id` ORDER BY `n-instock` DESC,`n-order` ASC LIMIT 0, 24