From: Dagfinn Ilmari Mannsåker Date: Thu, 24 Jul 2014 16:30:01 +0000 (+0100) Subject: Quote table names in 'SHOW CREATE TABLE' in Parser::DBI::MySQL X-Git-Tag: v0.11021~16^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1ca5a5cb007ddb2f361d314ae4c26ddd4308aa4;p=dbsrgits%2FSQL-Translator.git Quote table names in 'SHOW CREATE TABLE' in Parser::DBI::MySQL --- diff --git a/lib/SQL/Translator/Parser/DBI/MySQL.pm b/lib/SQL/Translator/Parser/DBI/MySQL.pm index 7907690..eea9522 100644 --- a/lib/SQL/Translator/Parser/DBI/MySQL.pm +++ b/lib/SQL/Translator/Parser/DBI/MySQL.pm @@ -40,7 +40,7 @@ sub parse { my $create = q{}; for my $table_name ( @table_names ) { next if (grep /^$table_name$/, @skip_tables); - my $sth = $dbh->prepare("show create table $table_name"); + my $sth = $dbh->prepare("show create table " . $dbh->quote_identifier($table_name)); $sth->execute; my $table = $sth->fetchrow_hashref; $create .= ($table->{'create table'} || $table->{'create view'}) . ";\n\n";