diff options
Diffstat (limited to 'phpBB/includes/db/db_tools.php')
-rw-r--r-- | phpBB/includes/db/db_tools.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 0e3173c23e..c1af2782f8 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -419,7 +419,7 @@ class phpbb_db_tools if (isset($prepared_column['auto_increment']) && strlen($column_name) > 26) // "${column_name}_gen" { - trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR); + trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } // here we add the definition of the new column to the list of columns @@ -2056,9 +2056,11 @@ class phpbb_db_tools { $statements = array(); - if (strlen($table_name . $index_name) > 30) + $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config) + if (strlen($table_name . $index_name) - strlen($table_prefix) > 24) { - trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR); + $max_length = $table_prefix + 24; + trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR); } switch ($this->sql_layer) @@ -2091,9 +2093,11 @@ class phpbb_db_tools { $statements = array(); - if (strlen($table_name . $index_name) > 30) + $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config) + if (strlen($table_name . $index_name) - strlen($table_prefix) > 24) { - trigger_error("Index name '${table_name}_$index_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR); + $max_length = $table_prefix + 24; + trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR); } // remove index length unless MySQL4 |