[Dbix-class] [PATCH] Schema::Loader with reserved table name

Tatsuhiko Miyagawa miyagawa at gmail.com
Wed Aug 1 08:06:37 GMT 2007


The following patch fixes some weird bugs when I used the table name
'show' with mysql.

I'm not subscribed to the -devel mailing list. Forward this if needed.

--- DBIx/Class/Schema/Loader/DBI.pm.old 2006-11-01 08:34:03.000000000 -0800
+++ DBIx/Class/Schema/Loader/DBI.pm     2007-07-31 06:29:30.000000000 -0700
@@ -91,7 +91,7 @@
         $table = $self->{db_schema} . $self->{_namesep} . $table;
     }

-    my $sth = $dbh->prepare("SELECT * FROM $table WHERE 1=0");
+    my $sth = $dbh->prepare("SELECT * FROM " .
$dbh->quote_identifier($table) . " WHERE 1=0");
     $sth->execute;
     return \@{$sth->{NAME_lc}};
 }


-- 
Tatsuhiko Miyagawa



More information about the DBIx-Class mailing list