Index: trunk/core/units/general/helpers/multilanguage.php =================================================================== diff -u -N -r5248 -r5514 --- trunk/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 5248) +++ trunk/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 5514) @@ -23,6 +23,13 @@ var $curSourceField = false; /** + * Indexes used in table of 32 + * + * @var int + */ + var $curIndexCount = 0; + + /** * Fields from config, that are currently used * * @var Array @@ -71,6 +78,7 @@ if (!getArrayValue($structure_status, $table_name)) { $this->curStructure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field'); + $this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name)); $structure_status[$table_name] = true; } } @@ -209,10 +217,11 @@ $field_expression = sprintf($field_mask, $start_index); $ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, '; - if ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang) { + if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) { // create index for primary language column + for all others (if multiple languages installed) - list($field_name, $field_params) = explode(' ', $field_expression, 2); - $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), '; + list($field_name, $field_params) = explode(' ', $field_expression, 2); + $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), '; + $this->curIndexCount++; } $start_index++;