From: Geistteufel Date: Wed, 31 Aug 2011 13:39:33 +0000 (+0200) Subject: quote reference_table X-Git-Tag: v0.11009~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ee6e2ec3aad5044e1340f4c3b41ee1faed1728c8;hp=3e814930c497a91b80e91a7ae7a2e51178b47c48;p=dbsrgits%2FSQL-Translator.git quote reference_table --- diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index bfa1da6..5ae406e 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -738,6 +738,8 @@ sub create_constraint my $qt = $options->{quote_table_names} || ''; my $leave_name = $options->{leave_name} || undef; + my $reference_table_name = quote_table_name($c->reference_table, $qt); + my @fields = $c->fields or next; if ( $c->type eq PRIMARY_KEY ) { @@ -767,7 +769,7 @@ sub create_constraint $def .= ' ('.$qf . join( "$qf, $qf", @fields ) . $qf . ')'; - $def .= ' REFERENCES ' . $qt . $c->reference_table . $qt; + $def .= ' REFERENCES ' . $reference_table_name; my @rfields = map { $_ || () } $c->reference_fields; unless ( @rfields ) {