From c6394785174db6f5a400040fc71a671061589e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Thu, 24 Jul 2014 17:30:01 +0100 Subject: [PATCH] Quote table names in 'SHOW CREATE TABLE' in Parser::DBI::MySQL --- lib/SQL/Translator/Parser/DBI/MySQL.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SQL/Translator/Parser/DBI/MySQL.pm b/lib/SQL/Translator/Parser/DBI/MySQL.pm index 7907690fb..eea95226f 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";