Tygh\Exceptions\AException

Message

Table './motorsbay/cscart_product_popularity' is marked as crashed and should be repaired (145)

SELECT SQL_CALC_FOUND_ROWS products.product_id, (CASE WHEN descr1.cp_st_h1 <> '' THEN descr1.cp_st_h1 ELSE descr1.product END) AS product, companies.company as company_name, popularity.total as popularity, products.product_type, products.parent_product_id, descr1.cp_hash_template_as_timestamp_value, CASE WHEN csc_product_currency_items.currency IS NULL THEN "D" ELSE csc_product_currency_items.currency END as currency, products.amount, products.purchase_qty, products.is_invoice, products.ei_order_id, products.ei_status, products.ei_for_user_id FROM cscart_products as products LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id AND descr1.lang_code = 'ar' LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id AND prices.lower_limit = 1 LEFT JOIN cscart_companies AS companies ON companies.company_id = products.company_id INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = '' OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN ('A', 'H') AND cscart_categories.storefront_id IN (0, 1) LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id LEFT JOIN cscart_csc_product_currency_items as csc_product_currency_items ON csc_product_currency_items.product_id=products.product_id AND csc_product_currency_items.company_id=0 WHERE 1 AND cscart_categories.category_id IN (502, 505, 506, 512, 513, 556, 557) AND companies.status IN ('A', 'S') AND products.company_id IN (1, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 0) AND popularity.total >= 1 AND (products.usergroup_ids = '' OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN ('A') AND prices.usergroup_id IN (0, 0, 1) AND products.parent_product_id = 0 AND products.is_invoice = 'N' AND products.product_type != 'D' GROUP BY products.product_id ORDER BY popularity.total desc, products.product_id ASC LIMIT 0, 10

Error at

app/Tygh/Database/Connection.php, line: 1712

Backtrace

File:app/Tygh/Database/Connection.php
Line:1489
Function:throwError
File:app/Tygh/Database/Connection.php
Line:699
Function:execQuery
File:app/Tygh/Database/Connection.php
Line:332
Function:query
File:app/functions/fn.database.php
Line:35
Function:getArray
File:app/functions/fn.products.php
Line:2354
Function:db_get_array
File:app/functions/fn.products.php
Line:2437
Function:{closure}
File:app/Tygh/BlockManager/Block.php
Line:974
Function:fn_get_products
File:app/Tygh/BlockManager/RenderManager.php
Line:810
Function:getItems
File:app/Tygh/BlockManager/RenderManager.php
Line:666
Function:getValue
File:app/Tygh/BlockManager/RenderManager.php
Line:493
Function:renderBlockContent
File:app/Tygh/BlockManager/RenderManager.php
Line:415
Function:renderBlock
File:app/Tygh/BlockManager/RenderManager.php
Line:373
Function:renderBlocks
File:app/Tygh/BlockManager/RenderManager.php
Line:230
Function:renderGrid
File:app/Tygh/BlockManager/RenderManager.php
Line:200
Function:renderGrids
File:app/Tygh/BlockManager/RenderManager.php
Line:164
Function:_renderContainer
File:app/functions/smarty_plugins/function.render_location.php
Line:52
Function:render
File:var/cache/templates/abt__unitheme2/cd272fe20f04e2070aa7b8268e7fa58954a2ece7_2.tygh.index.tpl.php
Line:159
Function:smarty_function_render_location
File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php
Line:123
Function:content_66b0e4193e44d6_82438573
File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php
Line:114
Function:getRenderedTemplateCode
File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php
Line:216
Function:render
File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php
Line:238
Function:render
File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php
Line:116
Function:_execute
File:app/Tygh/SmartyEngine/Core.php
Line:81
Function:fetch
File:app/functions/fn.control.php
Line:632
Function:fetch
File:index.php
Line:19
Function:fn_dispatch