[Bast-commits] r6594 - 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 11:46:38 GMT 2009
Author: caelum
Date: 2009-06-10 11:46:37 +0000 (Wed, 10 Jun 2009)
New Revision: 6594
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:
Sybase::NoBindVars now correctly quotes
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 11:44:02 UTC (rev 6593)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm 2009-06-10 11:46:37 UTC (rev 6594)
@@ -53,10 +53,11 @@
foreach my $bound (@$bind) {
my $col = shift @$bound;
- my $datatype = 'FIXME!!!';
+ $col =~ s/^([^.]*)\.//;
+ my $alias = $1 || 'me';
-# this is what needs to happen:
-# my $datatype = $rsrc->column_info($col)->{data_type};
+ my $datatype = $self->_resolve_ident_sources($ident)->{$alias}
+ ->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 11:44:02 UTC (rev 6593)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm 2009-06-10 11:46:37 UTC (rev 6594)
@@ -37,15 +37,10 @@
return $self->next::method(@_) if not defined $value;
-## this is the correct method, but we have no type yet
-# if (my $key = List::Util::first { $type =~ /$_/i } keys %noquote) {
-# return 0 if $noquote{$key}->($value);
-# }
+ if (my $key = List::Util::first { $type =~ /$_/i } keys %noquote) {
+ return 0 if $noquote{$key}->($value);
+ }
-# temporary hack
- return 0 if Scalar::Util::looks_like_number($value) ||
- ($value =~ /^\$(\S*)\z/ && Scalar::Util::looks_like_number($1));
-
return $self->next::method(@_);
}
More information about the Bast-commits
mailing list