【发布时间】:2011-06-14 09:49:51
【问题描述】:
我的“分类产品”索引有问题。它根本不会重新索引。错误开始时我在 1.4 上,现在我在 1.5 上,它仍然存在。
我试过了:
- 使用 magento 数据库修复工具修复数据库
- 清除 var、所有缓存、锁、会话
- 确保所有权限都正确。
- 扯掉我的头发。
无论如何我可以进一步调查这个问题吗?错误日志没有记录这个问题,我有点不知所措。任何帮助都将非常非常感激。
编辑:回显错误消息后,我得到:报告! SQLSTATE[21S01]:插入值列表与列列表不匹配:1136 列计数与第 1 行的值计数不匹配。
编辑 2:我运行了一个查询日志并获得了以下信息。如果您不介意看一下,看看是否有解决方案浮现在脑海中,我会非常高兴。有点过头了……
[2011-06-14 12:33:26] SQL: SELECT DISTINCT `catalog_product_bundle_selection`.`parent_product_id` FROM `catalog_product_bundle_selection` WHERE (product_id IN('180'))
EXCEPTION
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1' in /my-domain.com/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /my-domain.com/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /my-domain.com/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /my-domain.com/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO cat...', Array)
#3 /my-domain.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(335): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO cat...', Array)
#4 /my-domain.com/app/code/core/Mage/Index/Model/Mysql4/Abstract.php(159): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO cat...')
#5 /my-domain.com/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Indexer/Product.php(522): Mage_Index_Model_Mysql4_Abstract->insertFromSelect('SELECT? ...', 'catalog_categor...', Array)
#6 /my-domain.com/app/code/core/Mage/Index/Model/Indexer/Abstract.php(125): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Indexer_Product->reindexAll()
#7 /my-domain.com/app/code/core/Mage/Index/Model/Process.php(139): Mage_Index_Model_Indexer_Abstract->reindexAll()
#8 /my-domain.com/app/code/core/Mage/Index/Model/Process.php(167): Mage_Index_Model_Process->reindexAll()
#9 /my-domain.com/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#10 /my-domain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#11 /my-domain.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#12 /my-domain.com/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /my-domain.com/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#14 /my-domain.com/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#15 /my-domain.com/index.php(81): Mage::run('', 'store')
#16 {main}
编辑 3:查询本身!
SQL:
INSERT INTO catalog_category_anc_products_index_idx
SELECT STRAIGHT_JOIN DISTINCT ca.category_id, cp.product_id
FROM catalog_category_anc_categs_index_idx AS ca
INNER JOIN catalog_category_entity AS ce
ON ce.path LIKE ca.path OR ce.entity_id = ca.category_id
INNER JOIN catalog_category_product AS cp
ON cp.category_id = ce.entity_id
INNER JOIN catalog_category_product_index_enbl_idx as pv
ON pv.product_id = cp.product_id
【问题讨论】:
标签: magento indexing reporting