Query:
SELECT SQL_CALC_FOUND_ROWS
products.*, pva.position as avpos, pva.name as availabilityText,
CEIL( 100 *
IF(FIND_IN_SET(pl2ct.customers_type_id,hidePrice),
0,
IF(
price_action_from < NOW() AND (price_action_to + INTERVAL 1 DAY) > NOW() AND price_action > 0 AND
price_action IS NOT NULL,
ROUND(price_action * (tax_rate / 100 + 1), 2)
,
ROUND(price_EU * (tax_rate / 100 + 1), 2) * EXP(SUM(LOG(pl2ct.coefficient)))
)
)
) / 100 AS active_price,
CEIL(price_EU * EXP(SUM(LOG(pl2ct.coefficient))) * (1 + products.tax_rate / 100)) AS price,
EXP(SUM(LOG(pl2ct.coefficient))) as coefficient,
price_EU AS price_EU
FROM (
SELECT products.*
FROM products
LEFT JOIN
products_to_categories
ON products_to_categories.product_id = products.id
WHERE 1
AND visible = 1 AND products.id IN (1673806, 2203006, 2563155, 2609482, 2759860, 562974, 562975,
699877, 885147, 958556, 961741, 961742, 974320, 1223268, 1223269, 1345679, 1378510, 1379063,
1379325, 1735977, 4679244)
AND base_id IS NULL
GROUP BY products.id ) as products
LEFT JOIN productAvailability_valueList pva ON products.availability = pva.id
LEFT JOIN products_to_price_levels ON products_to_price_levels.productId = products.id
LEFT JOIN price_levels ON price_levels.id = products_to_price_levels.priceLevelId
LEFT JOIN price_levels_to_customers_types AS pl2ct ON pl2ct.price_level_id = price_levels.id AND
pl2ct.customers_type_id = 1
GROUP BY products.id
ORDER BY
FIELD(products.id,1673806,2203006,2563155,2609482,2759860,562974,562975,699877,885147,958556,961741,961742,974320,1223268,1223269,1345679,1378510,1379063,1379325,1735977,4679244)
LIMIT 0,9
Error message
MySQL server has gone away
Trace:
#0 /var/www/vhosts/falcon-parts.cz/httpdocs/vendor/dibi/dibi/src/Dibi/Drivers/MySqliDriver.php(151): Dibi\Drivers\MySqliDriver::createException('MySQL server ha...', 2006, 'SELECT SQL_CALC...')
#1 /var/www/vhosts/falcon-parts.cz/httpdocs/vendor/dibi/dibi/src/Dibi/Connection.php(275): Dibi\Drivers\MySqliDriver->query('SELECT SQL_CALC...')
#2 /var/www/vhosts/falcon-parts.cz/httpdocs/vendor/dibi/dibi/src/Dibi/Connection.php(203): Dibi\Connection->nativeQuery('SELECT SQL_CALC...')
#3 /var/www/vhosts/falcon-parts.cz/httpdocs/application/lib/Model/Dibi.php(66): Dibi\Connection->query(Array)
#4 /var/www/vhosts/falcon-parts.cz/httpdocs/class/Catalogue.php(95): Model_Dibi->query(Array)
#5 /var/www/vhosts/falcon-parts.cz/httpdocs/class/Helpers/CatalogueSmartyHelper.php(191): Catalogue->getProducts()
#6 /var/www/vhosts/falcon-parts.cz/httpdocs/class/Template/AdvancedSearch.php(263): Helpers\CatalogueSmartyHelper::smartyCatalogue(Object(Page))
#7 /var/www/vhosts/falcon-parts.cz/httpdocs/class/Template/AdvancedSearch.php(40): Template\AdvancedSearch->getSearchData()
#8 /var/www/vhosts/falcon-parts.cz/httpdocs/class/Template/System.php(42): Template\AdvancedSearch->loadTemplateSmartyData()
#9 /var/www/vhosts/falcon-parts.cz/httpdocs/class/LayoutSmarty.php(30): Template\System->render()
#10 /var/www/vhosts/falcon-parts.cz/httpdocs/class/Reflex.php(538): LayoutSmarty::render(Object(PageData), 'pt_advanced_sea...')
#11 /var/www/vhosts/falcon-parts.cz/httpdocs/index.php(78): Reflex::display()
#12 {main}