[Bast-commits] r6604 - in DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI: . Sybase

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Wed Jun 10 16:17:32 GMT 2009


Author: caelum
Date: 2009-06-10 16:17:31 +0000 (Wed, 10 Jun 2009)
New Revision: 6604

Modified:
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm
   DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
Log:
cache rsrc properly in NoBindVars, return undef if no rsrc

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm	2009-06-10 16:08:25 UTC (rev 6603)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm	2009-06-10 16:17:31 UTC (rev 6604)
@@ -62,8 +62,7 @@
 
     my $rsrc = $alias2src->{$alias};
 
-    my $datatype = $rsrc ? $rsrc->column_info($col)->{data_type} :
-        '__UNKNOWN__';
+    my $datatype = $rsrc && $rsrc->column_info($col)->{data_type};
 
     foreach my $data (@$bound) {
         if(ref $data) {

Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm	2009-06-10 16:08:25 UTC (rev 6603)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm	2009-06-10 16:17:31 UTC (rev 6604)
@@ -37,9 +37,11 @@
 
   return $self->next::method(@_) if not defined $value;
 
+  $type ||= '';
+
   if (my $key = List::Util::first { $type =~ /$_/i } keys %noquote) {
     return 0 if $noquote{$key}->($value);
-  } elsif ($type eq '__UNKNOWN__') {
+  } elsif (not $type) {
 # try to guess based on value
     return 0 if $number->($value) || $noquote->{money}->($value);
   }




More information about the Bast-commits mailing list