长时间等待目录规则应用后,我收到此错误:
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '44657-0-2' for key 'PRIMARY', query was: INSERT INTO
catalog_product_index_price_tmp
SELECTcatalog_product_index_price_final_tmp
.entity_id
,catalog_product_index_price_final_tmp
.customer_group_id
,catalog_product_index_price_final_tmp
.website_id
,catalog_product_index_price_final_tmp
.tax_class_id
,catalog_product_index_price_final_tmp
.orig_price
ASprice
,catalog_product_index_price_final_tmp
.price
ASfinal_price
,catalog_product_index_price_final_tmp
.min_price
,catalog_product_index_price_final_tmp
.max_price
,catalog_product_index_price_final_tmp
.tier_price
,catalog_product_index_price_final_tmp
.group_price
FROMcatalog_product_index_price_final_tmp
'
我尝试重建索引、重新启动 MySQL 并且仍然是一样的,在等待大约 40 分钟以应用一条规则后,我得到了这样的错误。
我也在本地尝试使用相同的数据库和代码来应用规则,它们运行良好。
我正在运行 Magento 1.14,这是在从 Magento 1.11 升级后发生的,但只发生在一台服务器上,而不是在测试服务器上,也不是在具有相同数据库和代码的本地。
关于我可以做什么来应用规则有什么建议吗? 我需要在服务器上检查任何配置吗?
提前致谢。
最佳答案
在管理员上:
System > Configuration > Index Management > Index Options
将所有索引更改为计划时更新,重新索引所有索引,应用目录规则。
这解决了我的问题。
希望对你有帮助。
关于php - Magento 目录规则违反 MySQL 完整性约束错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33069613/