Błąd 1118 Row size too large podczas indeksowania Product Flat Data

< 1 min czytania

Rozwiązanie na : Błąd 1118 Row size to large podczas indeksowania Product Flat Data


 

Podczas reindeksacji “Product Flat Data” Magento przestanie odpowiadać i pozostawi log:
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

Pomóc może zmiana w pliku:
app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php

# ~530
if (!$this->_isFlatTableExists($store)) {
    $sql = &quot;CREATE TABLE {$tableNameQuote} (\n&quot;;

    foreach ($columns as $field => $fieldProp) {
+      if ($fieldProp['type'] == &quot;varchar(255)&quot;)
+        $fieldProp['type'] = &quot;varchar(64)&quot;;
      $sql .= sprintf(&quot;  %s,\n&quot;,
          $this->_sqlColunmDefinition($field, $fieldProp));

...

# ~633
  foreach ($addIndexes as $indexName => $indexProp) {
      $sql .= sprintf(' ADD %s,',
          $this->_sqlIndexDefinition($indexName, $indexProp));
  }
  $sql = rtrim($sql, &quot;,&quot;);
+  $sql = str_replace(&quot;varchar(255)&quot;,&quot;varchar(64)&quot;,$sql);
  $this->_getWriteAdapter()->query($sql);
Menu