Error writing file '/tmp/MYS7cd6f' (Errcode: 28 - No space left on device)
SELECT SQL_CALC_FOUND_ROWS IF (in_stock = 0,2,1) AS ss, 1 AS ord, p.*, x.giftID, y.stock, case when y.stock > 0 then ROUND(p.Price*(1-y.stock/100)) else Price end stock_price, name_ru AS _name_sort FROM SC_products p LEFT JOIN ( SELECT SUBSTR(p.id, INSTR(p.id, '-')+1) giftID, it.productID FROM SC_product_list as p INNER JOIN SC_product_list_item as it ON p.id = it.list_id WHERE id LIKE 'gift-%' AND now() BETWEEN date_begin AND date_end ) x ON p.productID = x.productID LEFT JOIN ( SELECT SUBSTR(p.id, INSTR(p.id, '-')+1, 2) stock, it.productID FROM SC_product_list as p INNER JOIN SC_product_list_item as it ON p.id = it.list_id WHERE id LIKE 'stock-%' AND now() BETWEEN date_begin AND date_end ) y ON p.productID = y.productID WHERE ( (p.productID IN (602,604,606,823,824,846,928,929,932,942,943,944,946,965,978,979,982,991,1011,1016,1031,1036,1037,1039,1040,1041,1042,1043,1057,1059,1061,1062,1072,1080,1082,1083,1091,1092,1095,1100,1116,1130,1133,1138,1141,1146,1155,1156,1157,1190,1282,1302,1312,1328,1334,1344,1351,1387,1401,1406,1407,1421,1422,1441,1463,1464,1465,1508,1533,1534,1542,1548,1578,1591,1597,1599,1601,1619,1620,1621,1638,1642,1673,1675,1684,1738,1739,1803,1849,1850,1865,1867,1876,1894,1895,1934,1935,1936,1938,1959,1972,1990,1995,1997,1999,2015,2034,2039,2132,2138,2139,2140,2286,2300,2301,2303,2324,2340,2341,2348,2349,2350,2351,2358,2363,2399,2417,2420,2421,2422,2423,2436,2437,2439,2441,2446,2448,2449,2450,2452,2482,2502,2507,2565,2567,2592,2595,2599,2600,2611,2618,2631,2640,2641,2642,2645,2646,2647,2648,2667,2668,2681,2682,2683,2784,2794,2804,2807,2817,2831,2832,2836,2857,2858,2940,2981,2997,2998,3012,3013,3014,3015,3016,3020,3021,3022,3028,3031,3032,3047,3049,3052,3059,3081,3097,3099,3100,3122,3125,3133,3134,3140,3141,3145,3153,3154,3159,3194,3207,3209,3211,3218,3219,3223,3227,3233,3234,3235,3236,3237,3239,3240,3241,3249,3262,3265,3270,3272,3275,3277,3278,3288,3289,3296,3298,3300,3302,3303,3304,3305,3306,3307,3320,3321,3322,3324,3325,3326,3330,3331,3332,3334,3335,3356,3357,3358,3359,3363,3372,3373,3393,3420,3461,3508,3511,3523,3524,3532,3534,3535,3536,3537,3538,3573,3574,3601,3607,3655,3690,3706,3707,3708,3710,3712,3713,3719,3746,3791,3793,3794,3797,3803,3804,3807,3812,3813,3814,3815,3816,3817,3818,3819,3823,3826,3827,3835,3836,3855,3864,3866,3867,3879,3884,3886,3887,3928,3929,3937,3938,3939,3940,3941,3942,3943,3944,3945,3958,3967,3985,3987,3990,4000,4028,4030,4039,4041,4045,4052,4066,4074,4075,4094,4110,4111,4129,4157,4158,4167,4229,4230,4252,4254,4258,4259,4269,4275,4276,4317,4321,4333,4345,4348,4350,4353,4355,4356,4386,4387,4391,4393,4405,4423,4424,4459,4460,4481,4500,4501,4502,4503,4537,4538,4591,4594,4595,4598,4601,4602,4689,4707,4709,4711,4713,4715,4721,4744,4748,4749,4750,4751,4778,4801,4802,4806,4808,4820,4835,4875,4876,4877,4917,4918,4924,4926,4951,4965,4966,4969,4974,4979,5044,5060,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5088,5090,5091,5092,5096,5097,5098,5099,5100,5101,5102,5103,5104,5109,5117,5120,5121,5122,5134,5175,5176,5199,5308,5312,5335,5339,5343,5347,5348,5349,5350,5363,5364,5365,5432,5433,5434,5435,5444,5446,5448,5451,5452,5454,5464,5465,5480,5549,5608,5624,5625,5659,5661,5709,5714,5790,5831,5840,5972,5975,6005,6111,6118,6138,6139,6140,6141,6142,6143,6144,6145,6150,6151,6154,6155,6156,6157,6187,6227,6228,6229,6230,6231,6232,6233,6235,6329,6330,6331,6413,6415,6418,6419,6421,6422,6423,6434,6450,6555,6581,6583,6589,6590,6596,6651,6653,6654,6655,6660,6725,6729,6763,6824,6913,6945,7032,7074,7077,7091,7092,7247,7313,7467,7502,7503,7524,7561,7562,7570,7573,7574,7575,7576,7622,7660,7872,7895,7901,7902,7909,7944,7947,8054,8108,8133,8186,8187,8188,8191,8214,8215,8243,8244,8271,8409,8412,8421,8482,8573,8579,8610,8612,8613,8619,8620,8622,8624,8638,8643,8757,8764,8767,8770,8772,8794,8844,8871,8946,8950,9002,9003,9056,9105,9231,9640,9665,9703,9735,9738,9739,10122,10123,10124,10125,10126,10127,10128,10129,10130,10131,10518,10825,10950,10976,11013,11014,11106,11133,11135,11177,11178,11179,11191,11273,11327,11332,11333,11334,11336,11339,11469,11612,11799,11812,11889,11905,11918,12119,12371,12372,12440,12755,12764,12777,12785,12788,12848,12851,12954,12959,13280,13292,13293,13305,13306,13308,13309,13353,13355,13375,150,454,682,745,812,814,819,929,946,977,978,979,980,986,1028,1039,1041,1051,1056,1061,1068,1084,1091,1097,1101,1127,1130,1132,1134,1136,1158,1160,1161,1185,1190,1191,1226,1228,1254,1262,1299,1300,1311,1341,1350,1351,1366,1390,1396,1403,1406,1407,1408,1420,1421,1441,1464,1468,1508,1526,1528,1531,1532,1579,1581,1589,1593,1599,1602,1622,1650,1651,1673,1683,1706,1712,1731,1737,1747,1752,1823,1863,1932,1934,1985,1996,1998,2059,2073,2081,2098,2115,2122,2124,2148,2162,2164,2281,2284,2299,2300,2301,2302,2303,2304,2306,2313,2314,2322,2323,2337,2340,2341,2348,2349,2350,2354,2358,2362,2363,2394,2395,2405,2407,2412,2418,2419,2420,2421,2423,2450,2451,2456,2457,2460,2482,2504,2505,2511,2525,2526,2527,2528,2567,2574,2586,2587,2596,2604,2605,2623,2631,2640,2641,2652,2665,2679,2681,2682,2683,2691,2794,2804,2807,2857,2858,2943,2981,2992,2993,2998,3012,3013,3014,3015,3016,3020,3021,3022,3027,3028,3031,3032,3049,3059,3088,3097,3121,3122,3131,3134,3139,3140,3141,3145,3146,3147,3148,3149,3150,3151,3152,3217,3218,3219,3220,3221,3223,3225,3237,3239,3240,3241,3242,3271,3274,3276,3279,3280,3284,3285,3286,3287,3288,3289,3295,3296,3298,3334,3337,3338,3348,3349,3356,3357,3358,3359,3398,3399,3419,3435,3451,3455,3500,3501,3509,3510,3511,3514,3516,3600,3601,3603,3608,3655,3691,3706,3713,3720,3721,3722,3812,3816,3823,3824,3826,3839,3864,3865,3880,3883,3885,3887,3889,3896,3928,3929,3948,3949,3951,3952,3953,3958,3959,3964,3965,3966,3967,3970,3972,3985,3995,4001,4003,4004,4043,4044,4046,4057,4088,4094,4103,4113,4115,4116,4117,4155,4157,4159,4160,4188,4193,4265,4269,4342,4343,4345,4386,4393,4453,4459,4460,4492,4497,4500,4501,4502,4503,4538,4591,4593,4594,4595,4601,4706,4708,4710,4712,4714,4835,4883,4917,4918,4927,5060,5061,5068,5075,5076,5092,5096,5098,5104,5120,5121,5122,5124,5166,5191,5335,5339,5343,5347,5361,5363,5364,5365,5366,5522,5608,5610,5624,5625,5678,5686,5690,5822,6088,6191,6193,6241,6356,6422,6423,6581,6589,6590,6591,7007,7054,7065,7067,7075,7130,7313,7372,7402,7433,7434,7435,7511,7523,7536,7538,7540,7541,7570,7573,7574,7575,7576,7626,7628,7632,7802,7936,8023,8064,8131,8239,8263,8269,8299,8349,8350,8372,8479,8580,8639,8640,8766,8768,8769,8842,8843,8845,8958,8961,8972,8973,8974,8975,9208,9271,9707,9772,9971,10322,10540,10659,10730,10777,10779,10780,10790,10791,10975,11100,11114,11172,11250,11327,11332,11333,11334,11336,11447,11449,11450,11451,11452,11453,11454,11455,11456,11467,11468,11944,11946,12028,12254,12494,12511,12532,12583,12600,12601,12603,12756,12761,12803,12952,12953,12955,12956,12957,12958,12979,12980,12981,12982,12986,12987,12988,12989,12998,13027,13028,13280,903,946,1032,1058,1059,1066,1080,1082,1084,1092,1111,1222,1228,1254,1292,1306,1401,1652,1725,1726,1727,1971,1972,2324,2446,2448,2449,2615,2616,2617,2633,2634,2993,3032,3240,3241,3242,3513,3514,3515,4698,4699,4700,5686,5690,6451,6452,6823,7054,7131,7132,7626,9666,10587,10777,10780,10790,10791,1040,1056,1057,1058,1059,1062,1082,1084,1190,1191,1430,1440,1441,1442,1488,1508,1577,1578,1579,1580,1581,1582,1825,1965,1969,1970,1995,1996,1997,1998,1999,2075,2407,2416,2417,2418,2419,2452,2482,3031,3131,3201,3202,3205,3209,3213,3214,3215,3233,3234,3235,3236,3271,3272,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3446,3447,3472,3473,3474,3475,3741,3791,3793,3794,3795,3796,3797,3798,3799,3800,3801,3802,3803,3804,3805,3806,3807,3808,3825,3835,3836,3837,3851,3864,3865,3866,3867,3875,3928,3929,3937,3938,3939,3940,3941,3942,3943,3944,3945,3967,4039,4040,4041,4052,4107,4110,4111,4207,4269,4270,4271,4272,4273,4274,4307,4308,4309,4310,4311,4333,4383,4392,4393,4430,4432,4433,4434,4436,4437,4438,4459,4460,4478,4479,4480,4537,4538,4539,4541,4548,4591,4593,4597,4598,4599,4600,4601,4602,4637,4638,4639,4640,4641,4642,4643,4647,4648,4655,4658,4659,4661,4662,4668,4669,4670,4671,4673,4674,4675,4676,4677,4678,4680,4681,4682,4683,4684,4695,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4722,4723,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4801,4802,4806,4808,4878,4881,4882,4926,4927,4946,4947,4948,4951,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4976,5060,5061,5069,5077,5078,5079,5081,5082,5083,5084,5085,5086,5090,5091,5092,5094,5095,5097,5099,5100,5101,5102,5103,5113,5120,5121,5122,5335,5339,5343,5347,5348,5349,5350,5351,5361,5363,5364,5365,5366,5383,5384,5413,5414,5433,5434,5435,5436,5454,5480,5481,5482,5623,5624,5625,5666,5678,5771,5822,6092,6093,6111,6117,6118,6138,6139,6140,6155,6156,6157,6227,6228,6229,6230,6231,6232,6233,6235,6245,6248,6249,6250,6329,6330,6331,6384,6413,6416,6418,6419,6421,6422,6423,6425,6426,6427,6428,6434,6451,6452,6453,6540,6586,6587,6588,6589,6590,6592,6596,6599,6616,6617,6618,6619,6620,6621,6622,6623,6696,6713,6714,6715,6716,6746,6748,6823,6824,6825,6912,6913,6920,6921,6922,6923,7313,7396,7401,7405,7409,7524,7759,7760,7762,7764,7765,7848,7901,7902,7904,7905,7907,7909,7910,7911,7912,7913,7914,7915,7916,8058,8115,8116,8117,8118,8137,8138,8140,8141,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8263,8308,8310,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8414,8415,8416,8417,8418,8419,8420,8421,8422,8479,8491,8492,8524,8525,8529,8572,8609,8610,8611,8612,8613,8614,8619,8620,8622,8657,8658,8659,8660,8771,8772,8934,8935,8936,8937,8938,8939,8942,8972,8973,8974,8975,9666,9769,9770,9772,9773,9774,9775,9777,9778,9979,10122,10123,10124,10125,10126,10127,10128,10129,10130,10131,11012,11100,11106,11114,11167,11311,11313,11396,11397,11398,11399,11776,11799,12544,12545,12546,154,929,1092,1932,2034,3012,3059,3122,3132,3141,3497,3498,3573,3655,3812,3814,3819,3866,3949,3959,4031,4041,4052,4066,4074,4075,4094,4129,4130,4229,4230,4321,4333,4355,4391,4722,4723,4801,4802,4806,4808,4918,4926,4927,4935,4951,5060,5166,5175,5339,5343,5347,5355,5361,5363,5364,5365,5366,5383,5384,5624,5625,5630,5659,5822,6228,6229,6331,6384,6420,6422,6423,6451,6452,6507,6581,6617,6619,6620,6621,6622,6623,6653,6660,6696,6713,6716,6746,6748,6823,6824,6825,6912,7396,7524,7601,7802,7897,7901,7904,7905,7907,7980,8084,8115,8116,8118,8137,8220,8275,8377,8379,8381,8382,8492,8585,8596,8683,8770,8908,9001,9002,9003,9190,9197,9613,9769,9946,9949,9973,10244,10561,10567,10588,10589,10676,10766,10780,10848,10857,10892,10894,10943,10946,10951,10962,10986,11000,11007,11012,11093,11100,11109,11110,11117,11133,11135,11167,11172,11178,11244,11273,11309,11311,11313,11327,11332,11333,11334,11336,11396,11397,11398,11399,11812,11953,12282,12283,12760,12761,12764,12773,12774,12775,13526,13527,2740,4293,6574,6764,6863,6864,6866,7253,7714,7953,8308,9106,9332,9446,9782,9945,9952,9978,11430,11431,11453,11484,11706,11933,12055,12298,6075,6079,6084,7555,7717,8810,8906,10031,10378,10822,10824,11012,11061,11119,11123,11304,11406,11571,11900,11903,11906,11908,11920,11922,12166,12316,12341,12342,12423,12488,12494,12513,12613,12667,12691,12692,13348,13349,13353,13354,13357,13375,13384,13385,13386,3068,3260,3993,4260,6816,6950,7089,8110,8152,8184,8245,8282,8538,8580,8880,8993,9360,9361,9362,9540,9541,9727,11028,11148,11149,11151,11267,11268,11280,11472,11731,11742,11880,12000,12669,12913,13514,10109,10110,10113,10114,10958,10983,10986,11092,11093,11094,11133,11137,11272,11273,11284,11288,11289,11294,11295,11300,11301,11415,11416,12499,12500,12501,12502,12503,12504,12506,12507,12509,12510,149,150,188,192,1122,5218,5409,7525,7526,7527,7528,8376,8523,8530,8766,8767,8963,8965,8966,8967,9165,9530,9532,9621,9654,9702,9707,10080,10591,10750,10751,10752,10753,10950,10951,11898,11903,11906,11908,12284,12285,12706,12707,12708,12710,12712,12713,12715,12716,12719,12720,12721,12722,12800,12802,12803,12964,12979,12980,12981,12982,12986,12987,12988,12989,12990,12995,12999,13000,2649,2652,4145,5108,6215,6217,7313,8263,11012,149,150,153,154,188,192,2273,2776,6078,6079,6081,6851,6863,7067,7071,7080,7081,7098,7099,7100,7450,7451,7452,7453,7457,7459,7460,7461,7462,7463,7464,7465,7661,7663,7666,7667,8044,8471,9426,9530,9652,9654,9796,9823,9825,9826,9827,10073,10078,10765,10769,10771,10887,10892,11684,11687,11688,11907,12130,12131,12253,12291,12518,12800,12802,12805,190,192,194,457,459,1878,2014,2065,4169,4226,5247,5620,7007,7008,7089,7473,7842,7871,8155,8266,8267,8269,8270,8271,8450,8451,8452,8573,8786,8909,8913,9237,9294,9322,9530,9531,9907,10518,10573,10574,10576,10733,10740,10741,10742,11018,11019,11020,11080,11083,11084,11513,11516,11518,11519,11520,11528,11529,11532,11533,11534,11535,11537,11620,11622,11624,11625,11703,11969,12132,12133,12298,12431,12475,12779,12781,12801,12802,12908,13053,13054,13055,13071,13153,13154,13176,13236,13240,13242,13243,13244,13564,6276,6278,6286,6295,7593,7871,7968,8108,8112,8573,8574,8997,8998,10733,10740,10741,11261,11339,11763,11792,11793,13564,9759,9760,9762,9763,9893,9894,9895,9966,9967,9968,9971,9973,9974,10520,10730,10819,10955,11067,11309,11909,11910,11980,12088,12108,12109,12110,12566,12773,12774,13425,13426,13526,13527,13528,176,895,1158,1277,1278,1321,1704,1912,2809,2810,3337,4226,4315,6075,6084,6128,6129,6200,6202,6204,6206,7089,8330,8692,9294,9365,9702,9707,10570,10631,10635,10640,10641,10662,11020,11625,11797,11869,11900,11903,11906,12321,12567,12669,12698,12699,12757,12805,12971,12979,12980,12981,12982,12986,12987,12988,12989,13027,13343,13514,188,3017,5548,6173,6180,6866,8371,8579,8767,9440,9469,10031,10074,10078,10526,10527,10532,10536,10592,10654,10659,10665,10771,11456,11517,12282,12291,12292,12294,12909,12921,12922,12923,12928,12934,12938,12990,1277,1704,2455,7069,8135,8615,10180,11191,11697,11939,12852,12853,12854,12915,1275,2345,4145,4873,5144,6081,7008,7333,7446,7566,7663,7871,8071,8111,8375,8427,8550,8579,8875,8920,9764,9782,9838,9943,10492,10572,10733,10763,10769,10974,11110,11111,11122,11449,11693,11907,11944,12093,12132,12133,13506,3768,6683,7073,7516,7570,7573,7613,8286,8770,9224,9227,10220,10533,10588,10598,10600,10644,10678,11013,11115,11172,11223,11309,11629,11903,12028,12032,12064,12066,12074,12107,12114,12120,12221,12225,12227,12283,12290,12379,12389,12427,12480,12494,12499,12509,12512,12524,12571,12575,12595,12609,12612,12623,12626,12653,12657,12665,12666,12675,12678,12683,12755,12775,13526,13527,13566,895,3337,3450,3451,3461,11930,11948,12117,12532,12606)) OR (categoryID IN (162,166,171,201,283,420,466,467,468,469,470,471,472,474,476,477,478,483,526,543,628,637,315)) ) AND ( enabled=1) ORDER BY sort_order , _name_sort LIMIT 200,40