a few last minute fixes, and release for 0.03001
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / mysql.pm
index 3767639..b83e2d5 100644 (file)
@@ -30,15 +30,9 @@ sub _table_fk_info {
     my ($self, $table) = @_;
 
     my $dbh = $self->schema->storage->dbh;
-    my $sth = $dbh->prepare('SHOW CREATE TABLE ?');
-    $sth->execute or die("Cannot get table definition for $table"
-                         . " (execute failed): $DBI::errstr");
-
-    my $table_def_ref = $sth->fetchrow_arrayref
-        or die ("Cannot get table definition for $table (no rows)");
-
+    my $table_def_ref = $dbh->selectrow_arrayref("SHOW CREATE TABLE $table")
+        or die ("Cannot get table definition for $table");
     my $table_def = $table_def_ref->[1] || '';
-    $sth->finish;
     
     my (@reldata) = ($table_def =~ /CONSTRAINT `.*` FOREIGN KEY \(`(.*)`\) REFERENCES `(.*)` \(`(.*)`\)/ig);