Select count(catalog.id) as n FROM catalog, (
SELECT t0.* FROM catalog_tree t0 WHERE id = "e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
UNION ALL
SELECT t1.* FROM catalog_tree AS n0 INNER JOIN catalog_tree AS t1 ON n0.id = t1.up WHERE n0.id ="e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
UNION ALL
SELECT t2.*
FROM catalog_tree AS n0 INNER JOIN catalog_tree AS t1 ON n0.id = t1.up INNER JOIN catalog_tree AS t2 ON t1.id = t2.up WHERE n0.id ="e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
UNION ALL
SELECT t3.* FROM catalog_tree AS n0 INNER JOIN catalog_tree AS t1 ON n0.id = t1.up INNER JOIN catalog_tree AS t2 ON t1.id = t2.up INNER JOIN catalog_tree AS t3 ON t2.id = t3.up WHERE n0.id ="e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
) tree where tree.id=catalog.cat and tree.hide=0 and catalog.hide=0 and catalog.total_cost>0 limit 1
Disk full (/tmp/#sql_21c7_10.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Select catalog.id, catalog.timesync, catalog.transit_count, catalog.transit_time, catalog.barcode, catalog.barpict, catalog.about, catalog.wt, catalog.vol, catalog.title, catalog.art, catalog.art1c, catalog.country, catalog.factory, catalog.alias, catalog.total_count, catalog.short, catalog.photo, catalog.cropped,
catalog.flag_hit, catalog.flag_hot, catalog.flag_new, catalog.flag_best, catalog.is_archive,
catalog.total_cost, (Select catalog_contrprices.cost from catalog_contrprices where catalog_contrprices.idc=catalog.id and catalog_contrprices.contragent="" limit 1) as elon_fixed_cost,
(Select round(catalog_contrate.rate*catalog_prices.cost,2) from catalog_contrate, catalog_prices where catalog_prices.idc=catalog.id and catalog_prices.idt=catalog_contrate.idt and catalog_contrate.contragent="" and ( catalog_contrate.idf=catalog.factory or catalog_contrate.idf="" ) order by if(catalog_contrate.idf=catalog.factory,1,0) desc limit 1) as elon_cost, catalog.total_sale, catalog.flag_sale, tree.alias as catalias, tree.title as cattitle, (Select count(*) from catalog_photo where catalog_photo.idt=catalog.id limit 1) as countphoto FROM catalog, (
SELECT t0.* FROM catalog_tree t0 WHERE id = "e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
UNION ALL
SELECT t1.* FROM catalog_tree AS n0 INNER JOIN catalog_tree AS t1 ON n0.id = t1.up WHERE n0.id ="e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
UNION ALL
SELECT t2.*
FROM catalog_tree AS n0 INNER JOIN catalog_tree AS t1 ON n0.id = t1.up INNER JOIN catalog_tree AS t2 ON t1.id = t2.up WHERE n0.id ="e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
UNION ALL
SELECT t3.* FROM catalog_tree AS n0 INNER JOIN catalog_tree AS t1 ON n0.id = t1.up INNER JOIN catalog_tree AS t2 ON t1.id = t2.up INNER JOIN catalog_tree AS t3 ON t2.id = t3.up WHERE n0.id ="e16036af-f24e-11e8-8e9b-0cc47a52ebf7"
) tree where tree.id=catalog.cat and tree.hide=0 and catalog.hide=0 and catalog.total_cost>0 order by catalog.defsort desc, catalog.timecreate desc limit 210,30
Disk full (/tmp/#sql_21c7_10.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")