From: Chuck Hagenbuch Date: Sun, 3 Oct 2010 17:40:01 +0000 (-0400) Subject: Make sure we don't generate MySQL index names longer than 64 characters X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d877d2f520b940a1cb9fae49ee829d9141d49563;p=horde.git Make sure we don't generate MySQL index names longer than 64 characters --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Mysql/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Mysql/Schema.php index 46df902ba..ae69e8efc 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Mysql/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Mysql/Schema.php @@ -367,6 +367,21 @@ class Horde_Db_Adapter_Mysql_Schema extends Horde_Db_Adapter_Base_Schema } /** + * Get the name of the index + * + * @param string $tableName + * @param array $options + */ + public function indexName($tableName, $options=array()) + { + $indexName = parent::indexName($tableName, $options); + if (strlen($indexName) > 64) { + $indexName = substr($indexName, 0, 64); + } + return $indexName; + } + + /** * SHOW VARIABLES LIKE 'name' * * @param string $name