From: Peter Rabbitson Date: Tue, 28 Apr 2009 07:43:29 +0000 (+0000) Subject: Fix mysql roundtrip glitch X-Git-Tag: v0.11008~163^2~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=daaf8bca17a2f5064bf51c4a2cf46e269b87ee52;p=dbsrgits%2FSQL-Translator.git Fix mysql roundtrip glitch --- diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index 40c59f2..1f517cd 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -612,9 +612,15 @@ sub create_index my $qf = $options->{quote_field_names} || ''; return join( ' ', - lc $index->type eq 'normal' ? 'INDEX' : $index->type . ' INDEX', - truncate_id_uniquely( $index->name, $options->{max_id_length} || $DEFAULT_MAX_ID_LENGTH ), - '(' . $qf . join( "$qf, $qf", $index->fields ) . $qf . ')' + lc $index->type eq 'normal' + ? 'INDEX' + : $index->type . ' INDEX' + , + $index->name + ? (truncate_id_uniquely( $index->name, $options->{max_id_length} || $DEFAULT_MAX_ID_LENGTH ) ) + : () + , + '(' . $qf . join( "$qf, $qf", $index->fields ) . $qf . ')' ); }