2013-02-28 48 views
1

我試圖重新索引catalog_product_flat,我得到這個錯誤:當試圖重新索引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個社區。 這是發生在從管理員或shell索引器重做索引。

回答

3

好,我找到解決辦法,我曾在/path/to/magento/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php改變方法_getFlatColumnsOldDefinition驗證碼:

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

向該之一:

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

這是一個安全的變化? – Alexandros 2018-01-09 08:35:20

0

magento的編程重新索引

ID代碼

1 catalog_product_attribute

2 catalog_product_price

3 CATALOG_URL

4 catalog_product_flat

5 catalog_category_flat

6 catalog_category_product

7 catalogsearch_stock

8 cataloginventory_stock

9 tag_summary

完全重新索引

爲($ i = 1; $ i < = 9; $ i ++){

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

$ process-> reindexAll();

} 個別重新索引

$過程=法師:: getModel( '索引/過程') - >負載(4);

$ process-> reindexAll();

1

This answer解決了屬性計數的根本問題,而不借助於模式或代碼修改。

相關問題