Bumping version to 1.59_01
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / DBI / MySQL.pm
index 3512fb7..1ad034d 100644 (file)
@@ -24,7 +24,7 @@ use SQL::Translator::Schema::Constants;
 use SQL::Translator::Parser::MySQL;
 
 our ( $DEBUG, @EXPORT_OK );
-our $VERSION = '1.59';
+our $VERSION = '1.59_01';
 $DEBUG   = 0 unless defined $DEBUG;
 
 sub parse {
@@ -40,10 +40,10 @@ 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'} . ";\n\n";
+        $create .= ($table->{'create table'} || $table->{'create view'}) . ";\n\n";
     }
 
     SQL::Translator::Parser::MySQL::parse( $tr, $create );