1

我正在尝试重新索引 catalog_product_flat 并且出现此错误:

Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs' in /path/to/magento/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /path/to/magento/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /path/to/magento/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /path/to/magento/lib/Zend/Db/Statement.php(320): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /path/to/magento/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /path/to/magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ma...', Array)
#5 /path/to/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ma...', Array)
#6 /path/to/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(340): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ma...')
#7 /path/to/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(839): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ma...')
#8 /path/to/magento/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(799): Varien_Db_Adapter_Pdo_Mysql->addColumn('mage_catalog_pr...', 'email_template', Array)
#9 /path/to/magento/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1390): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(1)
#10 /path/to/magento/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#11 /path/to/magento/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(336): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#12 /path/to/magento/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#13 /path/to/magento/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#14 /path/to/magento/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#15 /path/to/magento/shell/indexer.php(198): Mage_Shell_Compiler->run()
#16 {main}

重新索引是在 magento 企业 1.12 上基于从 magento 1.3.4 社区获取的数据完成的。从管理员或外壳索引器进行重新索引时会发生这种情况。

4

3 回答 3

3

好的,我找到了解决方案,我必须在方法 _getFlatColumnsOldDefinition 中更改 /path/to/magento/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php 此代码:

case 'varchar':
    $columns[$this->getAttributeCode()] = array(
        'type' => 'varchar(255)'

对此:

case 'varchar':
    $columns[$this->getAttributeCode()] = array(
        'type' => 'text'
于 2013-02-28T14:28:17.993 回答
1

该答案解决了属性计数的潜在问题,而无需借助架构或代码修改。

于 2013-08-06T17:34:40.203 回答
0

magento 以编程方式重新索引

识别码

1 个目录产品属性

2 目录产品价格

3 目录_url

4 catalog_product_flat

5 目录_类别_平面

6 目录_类别_产品

7 目录search_stock

8 目录inventory_stock

9 tag_summary

完全重新索引

对于 ($i = 1; $i <= 9; $i++) {

$process = Mage::getModel('index/process')->load($i);

$process->reindexAll();

} 个人重新索引

$process = Mage::getModel('index/process')->load(4);

$process->reindexAll();

于 2013-07-04T08:16:39.107 回答