0

When I run the indexer I get the following error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;

This is caused by the following:

LEFT JOIN catalog_product_entity AS tad_price ON tad_price.entity_id = e.entity_id AND tad_price.attribute_id = AND tad_price.store_id = 0

The attribute_id is empty. I've been searching the database for an errors but can't seem to find any. Can anyone help me out of give me some advice?

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND tad_price.store_id = 0 LEFT JOIN catalog_product_entity AS tas_price ON' at line 13, query was: INSERT INTO catalog_product_index_price_final_idx SELECT e.entity_id, cg.customer_group_id, cw.website_id, IF(IFNULL(tas_tax_class_id.value_id, -1) > 0, tas_tax_class_id.value, tad_tax_class_id.value) AS tax_class_id, IFNULL((IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value)), 0) AS orig_price, IFNULL((IF(IF(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value)) <= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value)) >= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IFNULL(tas_special_price.value_id, -1) > 0, tas_special_price.value, tad_special_price.value) < IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value), IF(IFNULL(tas_special_price.value_id, -1) > 0, tas_special_price.value, tad_special_price.value), IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value))), 0) AS price, IFNULL((IF(IF(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value)) <= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value)) >= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IFNULL(tas_special_price.value_id, -1) > 0, tas_special_price.value, tad_special_price.value) < IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value), IF(IFNULL(tas_special_price.value_id, -1) > 0, tas_special_price.value, tad_special_price.value), IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value))), 0) AS min_price, IFNULL((IF(IF(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value)) <= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value)) >= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IFNULL(tas_special_price.value_id, -1) > 0, tas_special_price.value, tad_special_price.value) < IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value), IF(IFNULL(tas_special_price.value_id, -1) > 0, tas_special_price.value, tad_special_price.value), IF(IFNULL(tas_price.value_id, -1) > 0, tas_price.value, tad_price.value))), 0) AS max_price, tp.min_price AS tier_price, tp.min_price AS base_tier FROM catalog_product_entity AS e CROSS JOIN customer_group AS cg CROSS JOIN store_website AS cw INNER JOIN catalog_product_index_website AS cwd ON cw.website_id = cwd.website_id INNER JOIN store_group AS csg ON csg.website_id = cw.website_id AND cw.default_group_id = csg.group_id INNER JOIN store AS cs ON csg.default_store_id = cs.store_id AND cs.store_id != 0 INNER JOIN catalog_product_website AS pw ON pw.product_id = e.entity_id AND pw.website_id = cw.website_id LEFT JOIN catalog_product_index_tier_price AS tp ON tp.entity_id = e.entity_id AND tp.website_id = cw.website_id AND tp.customer_group_id = cg.customer_group_id INNER JOIN catalog_product_entity_int AS tad_status ON tad_status.entity_id = e.entity_id AND tad_status.attribute_id = 97 AND tad_status.store_id = 0 LEFT JOIN catalog_product_entity_int AS tas_status ON tas_status.entity_id = e.entity_id AND tas_status.attribute_id = 97 AND tas_status.store_id = cs.store_id LEFT JOIN catalog_product_entity_int AS tad_tax_class_id ON tad_tax_class_id.entity_id = e.entity_id AND tad_tax_class_id.attribute_id = 133 AND tad_tax_class_id.store_id = 0 LEFT JOIN catalog_product_entity_int AS tas_tax_class_id ON tas_tax_class_id.entity_id = e.entity_id AND tas_tax_class_id.attribute_id = 133 AND tas_tax_class_id.store_id = cs.store_id LEFT JOIN catalog_product_entity AS tad_price ON tad_price.entity_id = e.entity_id AND tad_price.attribute_id = AND tad_price.store_id = 0 LEFT JOIN catalog_product_entity AS tas_price ON tas_price.entity_id = e.entity_id AND tas_price.attribute_id = AND tas_price.store_id = cs.store_id LEFT JOIN catalog_product_entity AS tad_special_price ON tad_special_price.entity_id = e.entity_id AND tad_special_price.attribute_id = AND tad_special_price.store_id = 0 LEFT JOIN catalog_product_entity AS tas_special_price ON tas_special_price.entity_id = e.entity_id AND tas_special_price.attribute_id = AND tas_special_price.store_id = cs.store_id LEFT JOIN catalog_product_entity_datetime AS tad_special_from_date ON tad_special_from_date.entity_id = e.entity_id AND tad_special_from_date.attribute_id = 79 AND tad_special_from_date.store_id = 0 LEFT JOIN catalog_product_entity_datetime AS tas_special_from_date ON tas_special_from_date.entity_id = e.entity_id AND tas_special_from_date.attribute_id = 79 AND tas_special_from_date.store_id = cs.store_id LEFT JOIN catalog_product_entity_datetime AS tad_special_to_date ON tad_special_to_date.entity_id = e.entity_id AND tad_special_to_date.attribute_id = 80 AND tad_special_to_date.store_id = 0 LEFT JOIN catalog_product_entity_datetime AS tas_special_to_date ON tas_special_to_date.entity_id = e.entity_id AND tas_special_to_date.attribute_id = 80 AND tas_special_to_date.store_id = cs.store_id WHERE (e.type_id = 'simple') AND (IF(IFNULL(tas_status.value_id, -1) > 0, tas_status.value, tad_status.value)=1) Product EAV index has been rebuilt successfully in 00:00:00 SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pp_default.store_id=0 INNER JOIN catalog_product_website AS product_we' at line 3, query was: SELECTrp.*, IFNULL(pp1.value, pp_default.value) ASdefault_priceFROMcatalogrule_productASrp INNER JOINcatalog_product_entityASeON e.entity_id = rp.product_id INNER JOINcatalog_product_entityASpp_defaultON pp_default.entity_id=e.entity_id AND (pp_default.attribute_id=) and pp_default.store_id=0 INNER JOINcatalog_product_websiteASproduct_websiteON product_website.product_id=rp.product_id AND product_website.website_id = rp.website_id AND product_website.website_id=1 LEFT JOINcatalog_product_entityASpp1ON pp1.entity_id=e.entity_id AND (pp1.attribute_id=) and pp1.store_id=1 ORDER BYrp.website_idASC,rp.customer_group_idASC,rp.product_idASC,rp.sort_orderASC,rp.rule_id` ASC

  • Can you post your code lines? – Khoa TruongDinh Apr 26 '17 at 17:09
  • It is just a plain Magento installation. No modules. added the full query/error – Robin Apr 26 '17 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.