Skip to content

Commit

Permalink
Quote table names in 'SHOW CREATE TABLE' in Parser::DBI::MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmari committed Aug 20, 2014
1 parent 3b236af commit bbbc498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/SQL/Translator/Parser/DBI/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit bbbc498

Please sign in to comment.