June 1, 2016 9:52 am
image_round

Magento 1.x fix Product Flat Data reindexing issue with row size too large

When you get some error like this

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'

Then you just have to update one file and 2 lines

app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php, decreasing the value of the length element on line 604 from 255 characters to 64 in the following array:

$columns[$this->getAttributeCode()] = array(
   'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
   'length' => '64',
   'unsigned' => false,
   'nullable' => true,
   'default' => null,
   'extra' => null
);

and  Decrease the value of the type element on line 677  from 255 characters to 64 in the following array:

$columns[$this->getAttributeCode()] = array(
   'type' => 'varchar(64)',
   'unsigned' => false,
   'is_null' => true,
   'default' => null,
   'extra' => null
);

Magento 1.x fix Product Flat Data reindexing issue with row size too large

When you get some error like this

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'

Then you just have to update one file and 2 lines

app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php, decreasing the value of the length element on line 604 from 255 characters to 64 in the following array:

$columns[$this->getAttributeCode()] = array(
   'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
   'length' => '64',
   'unsigned' => false,
   'nullable' => true,
   'default' => null,
   'extra' => null
);

and  Decrease the value of the type element on line 677  from 255 characters to 64 in the following array:

$columns[$this->getAttributeCode()] = array(
   'type' => 'varchar(64)',
   'unsigned' => false,
   'is_null' => true,
   'default' => null,
   'extra' => null
);